ISEbd-22. Baygulov A.A. Lab work 05 #6

Closed
tellsense wants to merge 8 commits from lab5 into lab4
2 changed files with 3 additions and 5 deletions
Showing only changes of commit 15f09ac242 - Show all commits

View File

@ -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)
{

View File

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