завершение лаба 5

This commit is contained in:
ALINA_KURBANOVA 2023-12-01 23:01:57 +04:00
parent 221fa13a09
commit 51d54979d4
4 changed files with 1 additions and 23 deletions

View File

@ -17,7 +17,6 @@
public EntityWarmlyLocomotiveWithTrumpet(int speed, double weight, Color bodyColor, Color public EntityWarmlyLocomotiveWithTrumpet(int speed, double weight, Color bodyColor, Color
additionalColor, bool trumpet,bool luggage) : base(speed, weight, bodyColor) additionalColor, bool trumpet,bool luggage) : base(speed, weight, bodyColor)
{ {
AdditionalColor = additionalColor; AdditionalColor = additionalColor;
Trumpet = trumpet; Trumpet = trumpet;
Luggage = luggage; Luggage = luggage;

View File

@ -90,7 +90,6 @@
buttonCancel.TabIndex = 5; buttonCancel.TabIndex = 5;
buttonCancel.Text = "Отмена"; buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true; buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
// //
// labelBasic // labelBasic
// //

View File

@ -1,5 +1,4 @@
using System.Windows.Forms; using WarmlyLocomotive.DrawningObjects;
using WarmlyLocomotive.DrawningObjects;
using WarmlyLocomotive.Entities; using WarmlyLocomotive.Entities;
namespace WarmlyLocomotive namespace WarmlyLocomotive
@ -20,8 +19,6 @@ namespace WarmlyLocomotive
/// Событие /// Событие
/// </summary> /// </summary>
public event Action<DrawningWarmlyLocomotive>? EventAddWarmlyLocomotive; public event Action<DrawningWarmlyLocomotive>? EventAddWarmlyLocomotive;
public FormWarmlyLocomotiveConfig(int pictureWidth, int pictureHeight) public FormWarmlyLocomotiveConfig(int pictureWidth, int pictureHeight)
{ {
_pictureWidth = pictureWidth; _pictureWidth = pictureWidth;
@ -36,11 +33,7 @@ namespace WarmlyLocomotive
panelBlack.MouseDown += PanelColor_MouseDown; panelBlack.MouseDown += PanelColor_MouseDown;
panelPurple.MouseDown += PanelColor_MouseDown; panelPurple.MouseDown += PanelColor_MouseDown;
buttonCancel.Click += (s, e) => Close(); buttonCancel.Click += (s, e) => Close();
} }
private void DrawWarmlyLocomotive() private void DrawWarmlyLocomotive()
{ {
Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height); Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height);
@ -49,7 +42,6 @@ namespace WarmlyLocomotive
_warmlylocomotive?.DrawTransport(gr); _warmlylocomotive?.DrawTransport(gr);
pictureBoxObject.Image = bmp; pictureBoxObject.Image = bmp;
} }
public void AddEvent(Action<DrawningWarmlyLocomotive> ev) public void AddEvent(Action<DrawningWarmlyLocomotive> ev)
{ {
if (EventAddWarmlyLocomotive == null) if (EventAddWarmlyLocomotive == null)
@ -103,13 +95,11 @@ namespace WarmlyLocomotive
} }
DrawWarmlyLocomotive(); DrawWarmlyLocomotive();
} }
private void PanelColor_MouseDown(object? sender, MouseEventArgs e) private void PanelColor_MouseDown(object? sender, MouseEventArgs e)
{ {
(sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor, (sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor,
DragDropEffects.Move | DragDropEffects.Copy); DragDropEffects.Move | DragDropEffects.Copy);
} }
/// <summary> /// <summary>
/// Добавление /// Добавление
/// </summary> /// </summary>
@ -122,7 +112,6 @@ namespace WarmlyLocomotive
EventAddWarmlyLocomotive?.Invoke(_warmlylocomotive); EventAddWarmlyLocomotive?.Invoke(_warmlylocomotive);
Close(); Close();
} }
private void labelColor_DragDrop(object sender, DragEventArgs e) private void labelColor_DragDrop(object sender, DragEventArgs e)
{ {
if (_warmlylocomotive?.EntityWarmlyLocomotive == null) if (_warmlylocomotive?.EntityWarmlyLocomotive == null)
@ -140,7 +129,6 @@ namespace WarmlyLocomotive
} }
DrawWarmlyLocomotive(); DrawWarmlyLocomotive();
} }
private void labelColor_DragEnter(object sender, DragEventArgs e) private void labelColor_DragEnter(object sender, DragEventArgs e)
{ {
if (e.Data.GetDataPresent(typeof(Color))) if (e.Data.GetDataPresent(typeof(Color)))
@ -152,7 +140,6 @@ namespace WarmlyLocomotive
e.Effect = DragDropEffects.None; e.Effect = DragDropEffects.None;
} }
} }
private void labelAddColor_DragDrop(object sender, DragEventArgs e) private void labelAddColor_DragDrop(object sender, DragEventArgs e)
{ {
if ((_warmlylocomotive?.EntityWarmlyLocomotive == null) || (_warmlylocomotive is DrawningWarmlyLocomotiveWithTrumpet == false)) if ((_warmlylocomotive?.EntityWarmlyLocomotive == null) || (_warmlylocomotive is DrawningWarmlyLocomotiveWithTrumpet == false))
@ -163,7 +150,6 @@ namespace WarmlyLocomotive
checkBoxLuggage.Checked, _pictureWidth, _pictureHeight); checkBoxLuggage.Checked, _pictureWidth, _pictureHeight);
DrawWarmlyLocomotive(); DrawWarmlyLocomotive();
} }
private void labelAddColor_DragEnter(object sender, DragEventArgs e) private void labelAddColor_DragEnter(object sender, DragEventArgs e)
{ {
if (e.Data.GetDataPresent(typeof(Color))) if (e.Data.GetDataPresent(typeof(Color)))
@ -179,10 +165,5 @@ namespace WarmlyLocomotive
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
private void ButtonCancel_Click(object sender, EventArgs e)
{
}
} }
} }

View File

@ -7,7 +7,6 @@ namespace WarmlyLocomotive.Generics
readonly Dictionary<string, WarmlyLocomotivesGenericCollection<DrawningWarmlyLocomotive, DrawningObjectWarmlyLocomotive>> _warmlylocomotiveStorages; readonly Dictionary<string, WarmlyLocomotivesGenericCollection<DrawningWarmlyLocomotive, DrawningObjectWarmlyLocomotive>> _warmlylocomotiveStorages;
public List<string> Keys => _warmlylocomotiveStorages.Keys.ToList(); public List<string> Keys => _warmlylocomotiveStorages.Keys.ToList();
private readonly int _pictureWidth; private readonly int _pictureWidth;
private readonly int _pictureHeight; private readonly int _pictureHeight;
public WarmlyLocomotivesGenericStorage(int pictureWidth, int pictureHeight) public WarmlyLocomotivesGenericStorage(int pictureWidth, int pictureHeight)
{ {