This commit is contained in:
AnnZhimol 2022-11-02 09:19:18 +04:00
parent 1e245ddeea
commit 55a92737a2
3 changed files with 4 additions and 14 deletions

View File

@ -13,7 +13,7 @@ namespace Warship
public partial class FormWarshipConfig : Form public partial class FormWarshipConfig : Form
{ {
DrawingWarship _warship = null; DrawingWarship _warship = null;
private event WarshipDelegate EventAddWarship; private event Action<DrawingWarship> EventAddWarship;
public FormWarshipConfig() public FormWarshipConfig()
{ {
InitializeComponent(); InitializeComponent();
@ -37,11 +37,11 @@ namespace Warship
PictureBoxWarship.Image = bmp; PictureBoxWarship.Image = bmp;
} }
public void AddEvent(WarshipDelegate ev) public void AddEvent(Action<DrawingWarship> ev)
{ {
if (EventAddWarship == null) if (EventAddWarship == null)
{ {
EventAddWarship = new WarshipDelegate(ev); EventAddWarship = ev;
} }
else else
{ {

View File

@ -39,7 +39,7 @@ namespace Warship
public Bitmap ShowSet() public Bitmap ShowSet()
{ {
Bitmap bmp = new(_pictureWidth, _pictureWidth); Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics gr = Graphics.FromImage(bmp); Graphics gr = Graphics.FromImage(bmp);
DrawBackground(gr); DrawBackground(gr);
DrawWarship(gr); DrawWarship(gr);

View File

@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Warship
{
public delegate void WarshipDelegate(DrawingWarship warship);
}