Skip to content

Commit

Permalink
Get double-click working
Browse files Browse the repository at this point in the history
  • Loading branch information
Hosch250 committed May 29, 2015
1 parent fb3c07d commit 10ebb3c
Showing 1 changed file with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public RemoveParametersDialog()
MethodParametersGrid.SelectionChanged += MethodParametersGrid_SelectionChanged;
RemoveButton.Click += RemoveButtonClicked;
AddButton.Click += AddButtonClicked;
MethodParametersGrid.CellMouseDoubleClick += MethodParametersGrid_CellMouseDoubleClick;
}

private void InitializeCaptions()
Expand Down Expand Up @@ -83,7 +84,7 @@ public void OnOkButtonClicked()
}
}

private void RemoveButtonClicked(object sender, EventArgs e)
private void MarkToRemoveParam()
{
if (_selectedItem != null)
{
Expand All @@ -92,7 +93,7 @@ private void RemoveButtonClicked(object sender, EventArgs e)
}
}

private void AddButtonClicked(object sender, EventArgs e)
private void MarkToAddParam()
{
if (_selectedItem != null)
{
Expand All @@ -101,6 +102,30 @@ private void AddButtonClicked(object sender, EventArgs e)
}
}

private void RemoveButtonClicked(object sender, EventArgs e)
{
MarkToRemoveParam();
}

private void AddButtonClicked(object sender, EventArgs e)
{
MarkToAddParam();
}

private void MethodParametersGrid_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (_selectedItem == null) { return; }

if (_selectedItem.IsRemoved)
{
MarkToAddParam();
}
else
{
MarkToRemoveParam();
}
}

private int GetFirstSelectedRowIndex(int index)
{
return MethodParametersGrid.SelectedRows[index].Index;
Expand Down

0 comments on commit 10ebb3c

Please sign in to comment.