A
Andrus
I need to validate document DataGridview rows. Rows can be different types:
invoice rows, order rows etc.
I created generic EventArgs type for this:
public class CellValidatedEventArgs<TRow> : EventArgs
where TRow : class , IRow
{
public string PropertyName;
public BindingList<TRow> Rows;
public CellValidatedEventArgs(BindingList<TRow> rows, string
propertyName)
{
Rows = rows;
PropertyName = propertyName;
}
}
My entity base class contains empty method to allow override :
class EntityBase {
public virtual void OnRowCellValidated<TRow>(TRow sender,
CellValidatedEventArgs<TRow> e)
where TRow : class, IRow { }
}
Is this best design pattern ?
Andrus,
invoice rows, order rows etc.
I created generic EventArgs type for this:
public class CellValidatedEventArgs<TRow> : EventArgs
where TRow : class , IRow
{
public string PropertyName;
public BindingList<TRow> Rows;
public CellValidatedEventArgs(BindingList<TRow> rows, string
propertyName)
{
Rows = rows;
PropertyName = propertyName;
}
}
My entity base class contains empty method to allow override :
class EntityBase {
public virtual void OnRowCellValidated<TRow>(TRow sender,
CellValidatedEventArgs<TRow> e)
where TRow : class, IRow { }
}
Is this best design pattern ?
Andrus,