From 8f4f105b75dd0aa5ad0eb50c9b38542a58931b70 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Thu, 3 Nov 2022 16:33:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D1=85=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D0=B9=20=D0=B8=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BE=D0=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Airbus/Airbus/FormPlaneConfig.Designer.cs | 4 +-- Airbus/Airbus/FormPlaneConfig.cs | 30 +++-------------------- 2 files changed, 6 insertions(+), 28 deletions(-) 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(); }