ISEbd-22. Baygulov A.A. Lab work 05 #6
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user