diff --git a/Airbus/Airbus/FormPlaneConfig.Designer.cs b/Airbus/Airbus/FormPlaneConfig.Designer.cs index c2b2ff0..a1a98b6 100644 --- a/Airbus/Airbus/FormPlaneConfig.Designer.cs +++ b/Airbus/Airbus/FormPlaneConfig.Designer.cs @@ -293,7 +293,7 @@ this.labelAddColor.Text = "Доп. цвет"; this.labelAddColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.labelAddColor.DragDrop += new System.Windows.Forms.DragEventHandler(this.LabelAddColor_DragDrop); - this.labelAddColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.LabelAddColor_DragEnter); + this.labelAddColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.LabelColor_DragEnter); // // labelBaseColor // @@ -306,7 +306,7 @@ this.labelBaseColor.Text = "Цвет"; this.labelBaseColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.labelBaseColor.DragDrop += new System.Windows.Forms.DragEventHandler(this.LabelBaseColor_DragDrop); - this.labelBaseColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.LabelBaseColor_DragEnter); + this.labelBaseColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.LabelColor_DragEnter); // // buttonAddObject // diff --git a/Airbus/Airbus/FormPlaneConfig.cs b/Airbus/Airbus/FormPlaneConfig.cs index 57ee7bc..c5303de 100644 --- a/Airbus/Airbus/FormPlaneConfig.cs +++ b/Airbus/Airbus/FormPlaneConfig.cs @@ -99,7 +99,7 @@ namespace Airbus } //проверка получаемой информации (её типа на соответсвие требуемому) - private void LabelBaseColor_DragEnter(object sender, DragEventArgs e) + private void LabelColor_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(Color))) { @@ -117,41 +117,19 @@ namespace Airbus //проверка на пустоту объекта if (_plane != null) { - if (e.Data.GetDataPresent(typeof(Color))) - { - _plane.Airbus.CorpusColor = (Color)e.Data.GetData(typeof(Color)); - } + _plane.Airbus.CorpusColor = (Color)e.Data.GetData(typeof(Color)); DrawPlane(); } } - //проверка получаемой информации (её типа на соответсвие требуемому) - private void LabelAddColor_DragEnter(object sender, DragEventArgs e) - { - if (e.Data.GetDataPresent(typeof(Color))) - { - e.Effect = DragDropEffects.Copy; - } - else - { - e.Effect = DragDropEffects.None; - } - } - //принимаем дополнительный цвет private void LabelAddColor_DragDrop(object sender, DragEventArgs e) { //проверка на пустоту объекта и правильную сущноть - if (_plane != null && _plane is DrawningSuperAirbus airbus) + if (_plane != null && _plane.Airbus is EntitySuperAirbus entityAirbus) { - if (e.Data.GetDataPresent(typeof(Color))) - { - if (airbus.Airbus is EntitySuperAirbus entityAirbus) - { - entityAirbus.AddColor = (Color)e.Data.GetData(typeof(Color)); - } - } + entityAirbus.AddColor = (Color)e.Data.GetData(typeof(Color)); DrawPlane(); }