From 15f09ac2429524005ffa09eaaea4afd584ede4ed Mon Sep 17 00:00:00 2001 From: tellsense Date: Sun, 12 Nov 2023 23:30:16 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ElectricLocomotive/DrawingElectricLocomotive.cs | 3 +-- .../ElectricLocomotive/FormLocomotiveConfig.cs | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs b/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs index 0617c6e..64921f7 100644 --- a/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs +++ b/ElectricLocomotive/ElectricLocomotive/DrawingElectricLocomotive.cs @@ -10,8 +10,7 @@ namespace ProjectElectricLocomotive.DrawingObjects { public class DrawingElectricLocomotive : DrawingLocomotive { - public DrawingElectricLocomotive(int speed, double weight, Color bodyColor, Color additionalColor, - bool pantograph, bool compartment, int width, int height) : base(speed, weight, bodyColor, width, height, 80, 52) + public DrawingElectricLocomotive(int speed, double weight, Color bodyColor, Color additionalColor, bool pantograph, bool compartment, int width, int height) : base(speed, weight, bodyColor, width, height, 80, 52) { if (EntityLocomotive != null) { diff --git a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs index 162119a..c9c7157 100644 --- a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs +++ b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveConfig.cs @@ -94,8 +94,7 @@ namespace ProjectElectricLocomotive private void PanelColor_MouseDown(object sender, MouseEventArgs e) { - (sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor, - DragDropEffects.Move | DragDropEffects.Copy); + (sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor, DragDropEffects.Move | DragDropEffects.Copy); } private void LabelColor_DragDrop(object sender, DragEventArgs e) @@ -120,7 +119,7 @@ namespace ProjectElectricLocomotive } private void LabelColor_DragEnter(object sender, DragEventArgs e) { - if (e.Data.GetDataPresent(typeof(Color))) + if (e.Data?.GetDataPresent(typeof(Color)) ?? false) { e.Effect = DragDropEffects.Copy; }