Skip to content

Commit

Permalink
Merge pull request #197 from Orace/codeclean/redundantdelegateconstru…
Browse files Browse the repository at this point in the history
…ctor

Remove redundant delegate constructor call.
  • Loading branch information
gsvgit authored Nov 22, 2019
2 parents 0416692 + 0fd03c4 commit 1bc1a1c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/QuickGraph.Data/DataSetGraphvizAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ GraphvizImageType imageType

private void InitializeFormat()
{
this.FormatVertex += new FormatVertexEventHandler<DataTable>(FormatTable);
this.FormatEdge += new FormatEdgeAction<DataTable, DataRelationEdge>(FormatRelationEdge);
this.FormatVertex += FormatTable;
this.FormatEdge += FormatRelationEdge;

this.CommonVertexFormat.Style = GraphvizVertexStyle.Solid;
this.CommonVertexFormat.Shape = GraphvizVertexShape.Record;
Expand Down
4 changes: 2 additions & 2 deletions src/QuickGraph.Graphviz/CondensatedGraphRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public CondensatedGraphRenderer(
protected override void Initialize()
{
base.Initialize();
this.Graphviz.FormatVertex+=new FormatVertexEventHandler<TGraph>(Graphviz_FormatVertex);
this.Graphviz.FormatEdge += new FormatEdgeAction<TGraph, CondensedEdge<TVertex, TEdge, TGraph>>(Graphviz_FormatEdge);
this.Graphviz.FormatVertex += Graphviz_FormatVertex;
this.Graphviz.FormatEdge += Graphviz_FormatEdge;
}


Expand Down
4 changes: 2 additions & 2 deletions src/QuickGraph.Graphviz/EdgeMergeCondensatedGraphRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public EdgeMergeCondensatedGraphRenderer(
protected override void Initialize()
{
base.Initialize();
this.Graphviz.FormatVertex += new FormatVertexEventHandler<TVertex>(Graphviz_FormatVertex);
this.Graphviz.FormatEdge += new FormatEdgeAction<TVertex, MergedEdge<TVertex, TEdge>>(Graphviz_FormatEdge);
this.Graphviz.FormatVertex += Graphviz_FormatVertex;
this.Graphviz.FormatEdge += Graphviz_FormatEdge;
}

void Graphviz_FormatEdge(object sender, FormatEdgeEventArgs<TVertex, MergedEdge<TVertex, TEdge>> e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ protected override void InternalCompute()
this.ds.Union(e.Source, e.Target);

// unhook/hook to graph event
this.VisitedGraph.EdgeAdded += new EdgeAction<TVertex, TEdge>(VisitedGraph_EdgeAdded);
this.VisitedGraph.EdgeRemoved += new EdgeAction<TVertex, TEdge>(VisitedGraph_EdgeRemoved);
this.VisitedGraph.VertexAdded += new VertexAction<TVertex>(VisitedGraph_VertexAdded);
this.VisitedGraph.VertexRemoved += new VertexAction<TVertex>(VisitedGraph_VertexRemoved);
this.VisitedGraph.EdgeAdded += VisitedGraph_EdgeAdded;
this.VisitedGraph.EdgeRemoved += VisitedGraph_EdgeRemoved;
this.VisitedGraph.VertexAdded += VisitedGraph_VertexAdded;
this.VisitedGraph.VertexRemoved += VisitedGraph_VertexRemoved;
}

public int ComponentCount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace QuickGraph.Algorithms.Search
{
Expand Down Expand Up @@ -122,12 +123,12 @@ private void RunBfs()
algo = new ParallelBreadthFirstSearchAlgorithm<int, Edge<int>, int>(g);
try
{
algo.InitializeVertex += new VertexEventHandler<int>(this.InitializeVertex);
algo.DiscoverVertex += new ParallelVertexEventHandler<int,int>(this.DiscoverVertex);
algo.ExamineVertex += new ParallelVertexEventHandler<int, int>(this.ExamineVertex);
algo.TreeEdge += new ParallelEdgeAction<int, Edge<int>, int>(this.TreeEdge);
algo.NextLevel += new EventHandler(algo_NextLevel);
algo.FinishVertex += new ParallelVertexEventHandler<int,int>(this.FinishVertex);
algo.InitializeVertex += this.InitializeVertex;
algo.DiscoverVertex += this.DiscoverVertex;
algo.ExamineVertex += this.ExamineVertex;
algo.TreeEdge += this.TreeEdge;
algo.NextLevel += this.algo_NextLevel;
algo.FinishVertex += this.FinishVertex;

parents.Clear();
distances.Clear();
Expand All @@ -145,11 +146,12 @@ private void RunBfs()
}
finally
{
algo.InitializeVertex -= new VertexEventHandler<int>(this.InitializeVertex);
algo.DiscoverVertex -= new ParallelVertexEventHandler<int,int>(this.DiscoverVertex);
algo.ExamineVertex -= new ParallelVertexEventHandler<int,int>(this.ExamineVertex);
algo.TreeEdge -= new ParallelEdgeAction<int, Edge<int>,int>(this.TreeEdge);
algo.FinishVertex -= new ParallelVertexEventHandler<int,int>(this.FinishVertex);
algo.InitializeVertex -= this.InitializeVertex;
algo.DiscoverVertex -= this.DiscoverVertex;
algo.ExamineVertex -= this.ExamineVertex;
algo.TreeEdge -= this.TreeEdge;
algo.NextLevel -= this.algo_NextLevel;
algo.FinishVertex -= this.FinishVertex;
}
}

Expand Down

0 comments on commit 1bc1a1c

Please sign in to comment.