private void Child_event_FromUC(object sender, myEventArgs e) { if (e.EventArgs_UC_2 == null) { dragClass myDragClass = new dragClass(); myDragClass.Drag_UC_1 = e.EventArgs_UC_1; myDragClass.Drag_Child_1 = this; this.DoDragDrop(myDragClass, DragDropEffects.All); } else { DragDropCounter++; if (DragDropCounter == 1) { UC_1 = e.EventArgs_UC_1; ButtonLabel_1 = e.EventArgs_Child_1.Text; RectangleSquare_1 = e.EventArgs_Child_1.Max_RectangleSquare.Text; if (e.EventArgs_Child_1.radioButtonRed.Checked) { Color_1 = "Red"; } if (e.EventArgs_Child_1.radioButtonGreen.Checked) { Color_1 = "Green"; } if (e.EventArgs_Child_1.radioButtonBlue.Checked) { Color_1 = "Blue"; } Max_RectangleSquare_control_1 = e.EventArgs_Child_1.Max_RectangleSquare_control; UC_2 = e.EventArgs_UC_2; ButtonLabel_2 = this.Text; RectangleSquare_2 = this.Max_RectangleSquare.Text; if (this.radioButtonRed.Checked) { Color_2 = "Red"; } if (this.radioButtonGreen.Checked) { Color_2 = "Green"; } if (this.radioButtonBlue.Checked) { Color_2 = "Blue"; } Max_RectangleSquare_control_2 = this.Max_RectangleSquare_control; Action_Max_RectangleSquare(); } else { ActionSort(); } } }
private void UserControl1_DragDrop(object sender, DragEventArgs e) { dragClass dragClass_temp = (dragClass)(e.Data.GetData(typeof(dragClass))); myEventArgs myEventArgs_temp = new myEventArgs(); myEventArgs_temp.EventArgs_UC_1 = dragClass_temp.Drag_UC_1; myEventArgs_temp.EventArgs_Child_1 = dragClass_temp.Drag_Child_1; myEventArgs_temp.EventArgs_UC_2 = this; if (event_FromUC != null) { event_FromUC(this, myEventArgs_temp); } }