Beispiel #1
0
 protected override void UnsubscribeControlEvents(ControlArray <Button> sender, Button control, int row, int column)
 {
     control.DragEnter  -= Control_DragEnter;
     control.DragDrop   -= Control_DragDrop;
     control.MouseMove  -= Control_MouseMove;
     control.MouseClick -= Control_MouseClick;
 }
Beispiel #2
0
 protected override void SubscribeControlEvents(ControlArray <Button> sender, Button control, int row, int column)
 {
     control.Text        = $"Row {row.ToString()}";
     control.Tag         = row;
     control.AllowDrop   = true;
     control.DragEnter  += Control_DragEnter;
     control.DragDrop   += Control_DragDrop;
     control.MouseMove  += Control_MouseMove;
     control.MouseClick += Control_MouseClick;
 }
Beispiel #3
0
 public ControlArrayContainer()
 {
     InitializeComponent();
     _controls = new ControlArray <T>
     {
         Parent = this,
         Dock   = DockStyle.Fill
     };
     _controls.ControlCreated   += SubscribeControlEvents;
     _controls.ControlDisposing += UnsubscribeControlEvents;
     Disposed += ControlArrayContainer_Disposed;
 }
 protected override void UnsubscribeControlEvents(ControlArray <TextBox> sender, TextBox control, int row, int column)
 {
     control.TextChanged -= Control_TextChanged;
 }
 protected override void SubscribeControlEvents(ControlArray <TextBox> sender, TextBox control, int row, int column)
 {
     control.TextChanged += Control_TextChanged;
     control.BackColor    = InvalidCellValueColor;
 }
Beispiel #6
0
 protected abstract void SubscribeControlEvents(ControlArray <T> sender, T control, int row, int column);