The designed class should be the first one in the file, otherwise VisualStudio's designer breaks.

In this case, the CheckableDataGridViewRowEventArgs are very specialised and can be nested in the CheckableDataGridView.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-05-01 13:56:53 +01:00 committed by Mihaela Stoica
parent 79684617eb
commit 6a36bf37ff
2 changed files with 8 additions and 9 deletions

View File

@ -32,7 +32,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
using XenAdmin.Core;
@ -40,17 +39,17 @@ using XenAPI;
namespace XenAdmin.Controls.CheckableDataGridView
{
public class CheckableDataGridViewRowEventArgs : EventArgs
{
public int RowIndex { get; set; }
public bool RefreshGrid { get; set; }
}
/// <summary>
/// NOTE: Ensure your first column is a checkbox column
/// </summary>
public class CheckableDataGridView : DataGridViewEx.DataGridViewEx, ICheckableDataGridViewView
{
public class CheckableDataGridViewRowEventArgs : EventArgs
{
public int RowIndex { get; set; }
public bool RefreshGrid { get; set; }
}
protected static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private const string RowUpdatedEventKey = "CheckableDataGridViewRowUpdatedEventKey";
private const string RowCheckedEventKey = "CheckableDataGridViewRowCheckedEventKey";

View File

@ -80,7 +80,7 @@ namespace XenAdmin.Dialogs
}
void checkableDataGridView_RowChecked(object sender, CheckableDataGridViewRowEventArgs e)
void checkableDataGridView_RowChecked(object sender, CheckableDataGridView.CheckableDataGridViewRowEventArgs e)
{
Controller.UpdateButtonEnablement();
}
@ -100,7 +100,7 @@ namespace XenAdmin.Dialogs
Controller.ReleaseLicenses(checkableDataGridView.CheckedRows);
}
private void checkableDataGridView_RowUpdated(object sender, CheckableDataGridViewRowEventArgs e)
private void checkableDataGridView_RowUpdated(object sender, CheckableDataGridView.CheckableDataGridViewRowEventArgs e)
{
LicenseCheckableDataGridView senderGrid = sender as LicenseCheckableDataGridView;
if (senderGrid == null || e.RowIndex >= senderGrid.Rows.Count || e.RowIndex < 0)