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; }