Фикс
This commit is contained in:
parent
63a8f431dc
commit
cf26999d5d
@ -293,7 +293,7 @@
|
|||||||
labelAdditionalColor.Text = "Доп. цвет";
|
labelAdditionalColor.Text = "Доп. цвет";
|
||||||
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
|
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
labelAdditionalColor.DragDrop += LabelAdditionalColor_DragDrop;
|
labelAdditionalColor.DragDrop += LabelAdditionalColor_DragDrop;
|
||||||
labelAdditionalColor.DragEnter += LabelAdditionalColor_DragDrop;
|
labelAdditionalColor.DragEnter += LabelAdditionalColor_DragEnter;
|
||||||
//
|
//
|
||||||
// labelBodyColor
|
// labelBodyColor
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@ public partial class FormPlanConfig : Form
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Объект - прорисовка самолёта
|
/// Объект - прорисовка самолёта
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private Drawningplane _plane=null;
|
private Drawningplane _plane = null;
|
||||||
|
|
||||||
private event Action<Drawningplane>? PlaneDelegate;
|
private event Action<Drawningplane>? PlaneDelegate;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -32,7 +32,7 @@ public partial class FormPlanConfig : Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Привязка внешнего метода к событию
|
/// Привязка внешнего метода к событию вопрос 2..............................................................................
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void AddEvent(Action<Drawningplane> planeDelegate)
|
public void AddEvent(Action<Drawningplane> planeDelegate)
|
||||||
{
|
{
|
||||||
@ -133,11 +133,11 @@ public partial class FormPlanConfig : Form
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ButtonAdd_Click(object sender, EventArgs e)
|
private void ButtonAdd_Click(object sender, EventArgs e)// кнопку нажимаем и новый объект передается в форму 2 вопрос............
|
||||||
{
|
{
|
||||||
if (_plane != null)
|
if (_plane != null)
|
||||||
{
|
{
|
||||||
PlaneDelegate?.Invoke(_plane);
|
PlaneDelegate?.Invoke(_plane); //Вызов события, с помощью инвок,
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,4 +155,19 @@ public partial class FormPlanConfig : Form
|
|||||||
}
|
}
|
||||||
DrawObject();
|
DrawObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LabelAdditionalColor_DragEnter(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
if (_plane != null && _plane is DrawningAiroplane)
|
||||||
|
{
|
||||||
|
if (e.Data?.GetDataPresent(typeof(Color)) ?? false)
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.Copy;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,13 +39,13 @@ public partial class FormPlaneCollection : Form
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ButtonAddPlane_Click(object sender, EventArgs e)
|
private void ButtonAddPlane_Click(object sender, EventArgs e)//вопрос 2 ...........................................................
|
||||||
{
|
{
|
||||||
FormPlanConfig form = new();
|
FormPlanConfig form = new();
|
||||||
// TODO передать метод
|
// TODO передать метод
|
||||||
|
|
||||||
form.Show();
|
form.Show();
|
||||||
form.AddEvent(SetPlane);
|
form.AddEvent(SetPlane); //////////////////////////////
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user