5 лаба (окончательные правки)
This commit is contained in:
parent
a258fe0f84
commit
c918183e43
@ -54,3 +54,4 @@ namespace ProjectElectricLocomotive.DrawingObjects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,3 +172,4 @@ namespace ProjectElectricLocomotive.DrawingObjects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace ProjectElectricLocomotive
|
||||
public partial class FormLocomotiveConfig : Form
|
||||
{
|
||||
DrawingLocomotive? _locomotive = null;
|
||||
private event LocomotiveDelegate? EventAddLocomotive;
|
||||
private event Action<DrawingLocomotive>? EventAddLocomotive;
|
||||
|
||||
public FormLocomotiveConfig()
|
||||
{
|
||||
@ -33,7 +33,7 @@ namespace ProjectElectricLocomotive
|
||||
buttonCancelObject.Click += (s, e) => Close();
|
||||
|
||||
}
|
||||
public void AddEvent(LocomotiveDelegate ev)
|
||||
public void AddEvent(Action<DrawingLocomotive> ev)
|
||||
{
|
||||
if (EventAddLocomotive == null)
|
||||
{
|
||||
@ -101,7 +101,6 @@ namespace ProjectElectricLocomotive
|
||||
{
|
||||
if (_locomotive == null)
|
||||
return;
|
||||
((Label)sender).BackColor = (Color)e.Data.GetData(typeof(Color));
|
||||
switch (((Label)sender).Name)
|
||||
{
|
||||
case "labelSimpleColor":
|
||||
@ -119,7 +118,7 @@ namespace ProjectElectricLocomotive
|
||||
}
|
||||
private void LabelColor_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data?.GetDataPresent(typeof(Color)) ?? false)
|
||||
if ((e.Data?.GetDataPresent(typeof(Color)) ?? false))
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ProjectElectricLocomotive.DrawingObjects;
|
||||
|
||||
namespace ProjectElectricLocomotive
|
||||
{
|
||||
public delegate void LocomotiveDelegate(DrawingLocomotive locomotive);
|
||||
}
|
Loading…
Reference in New Issue
Block a user