Skip to content

Commit 646bcef

Browse files
author
furmangg
committed
hopefully working around VS crash mentioned in issue #63
1 parent 5ce8712 commit 646bcef

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

SSIS/VariablesWindowPlugin.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,26 @@ private void HookupVariablesWindow(Window GotFocus)
196196

197197
private void grid_MouseButtonClicked(object sender, MouseButtonClickedEventArgs args)
198198
{
199-
// Fragile, as relies on hardcoded index. We are trying to replicate Microsoft.DataTransformationServices.Design.VariablesToolWindow.dlgGridControl1_MouseButtonClicked method check
200-
if (args.Button == MouseButtons.Left && args.ColumnIndex == 6)
199+
try
201200
{
202-
// Dumbass, the args.RowIndex is a long, but all the grid methods that accept a row index are int!
203-
EditExpressionButtonClick((int)args.RowIndex, args.ColumnIndex);
204-
}
201+
// Fragile, as relies on hardcoded index. We are trying to replicate Microsoft.DataTransformationServices.Design.VariablesToolWindow.dlgGridControl1_MouseButtonClicked method check
202+
if (args.Button == MouseButtons.Left && args.ColumnIndex == 6)
203+
{
204+
// Dumbass, the args.RowIndex is a long, but all the grid methods that accept a row index are int!
205+
EditExpressionButtonClick((int)args.RowIndex, args.ColumnIndex);
206+
}
207+
} catch { }
205208
}
206209

207210
//only way I could find to monitor when row data in the grid changes
208211
void grid_Invalidated(object sender, InvalidateEventArgs e)
209212
{
210-
CheckButtonIcons();
211-
RefreshHighlights();
213+
try
214+
{
215+
CheckButtonIcons();
216+
RefreshHighlights();
217+
}
218+
catch { }
212219
}
213220

214221
private void CheckButtonIcons()

0 commit comments

Comments
 (0)