Skip to content

Commit fa86632

Browse files
committed
Simplify delegates in RemoveDataGridItems call
1 parent 720ca92 commit fa86632

File tree

3 files changed

+12
-29
lines changed

3 files changed

+12
-29
lines changed

solution/GraphicalDebugging/GeometryWatchControl.xaml.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,10 @@ private void dataGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEven
155155
if (m_isDataGridEdited)
156156
return;
157157

158-
Util.RemoveDataGridItems(dataGrid,
159-
Geometries,
160-
delegate (int selectIndex) {
161-
ResetAt(new GeometryItem(), selectIndex);
162-
},
163-
delegate (GeometryItem geometry) {
164-
m_colorIds.Push(geometry.ColorId);
165-
},
166-
delegate () {
167-
UpdateItems(false);
168-
});
158+
Util.RemoveDataGridItems(dataGrid, Geometries,
159+
(int selectIndex) => ResetAt(new GeometryItem(), selectIndex),
160+
(GeometryItem geometry) => m_colorIds.Push(geometry.ColorId),
161+
() => UpdateItems(false));
169162
}
170163
}
171164

solution/GraphicalDebugging/GraphicalWatchControl.xaml.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,10 @@ private void dataGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEven
8181
if (m_isDataGridEdited)
8282
return;
8383

84-
Util.RemoveDataGridItems(dataGrid,
85-
Variables,
86-
delegate (int selectIndex) {
87-
ResetAt(new GraphicalItem(), selectIndex);
88-
},
89-
delegate (GraphicalItem variable) { },
90-
delegate () { });
84+
Util.RemoveDataGridItems(dataGrid, Variables,
85+
(int selectIndex) => ResetAt(new GraphicalItem(), selectIndex),
86+
(GraphicalItem variable) => { },
87+
() => { });
9188
}
9289
}
9390

solution/GraphicalDebugging/PlotWatchControl.xaml.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,10 @@ private void dataGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEven
156156
if (m_isDataGridEdited)
157157
return;
158158

159-
Util.RemoveDataGridItems(dataGrid,
160-
Plots,
161-
delegate (int selectIndex) {
162-
ResetAt(new PlotItem(), selectIndex);
163-
},
164-
delegate (PlotItem plot) {
165-
m_colorIds.Push(plot.ColorId);
166-
},
167-
delegate () {
168-
UpdateItems(false);
169-
});
159+
Util.RemoveDataGridItems(dataGrid, Plots,
160+
(int selectIndex) => ResetAt(new PlotItem(), selectIndex),
161+
(PlotItem plot) => m_colorIds.Push(plot.ColorId),
162+
() => UpdateItems(false));
170163
}
171164
}
172165

0 commit comments

Comments
 (0)