Terminate application after window close
This commit is contained in:
@@ -110,5 +110,12 @@ namespace WorldOfPeacecraft
|
|||||||
{
|
{
|
||||||
Gui.PerformRefresh();
|
Gui.PerformRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Stop() {
|
||||||
|
Parse.Stop ();
|
||||||
|
Send.Stop ();
|
||||||
|
Rec.Stop ();
|
||||||
|
System.Windows.Forms.Application.Exit ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ namespace WorldOfPeacecraft
|
|||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnClosing (System.ComponentModel.CancelEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnClosing (e);
|
||||||
|
Backend.Stop ();
|
||||||
|
}
|
||||||
|
|
||||||
public void DoPaint (object source, PaintEventArgs args)
|
public void DoPaint (object source, PaintEventArgs args)
|
||||||
{
|
{
|
||||||
BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate (Board.CreateGraphics (), Board.DisplayRectangle);
|
BufferedGraphics buffer = BufferedGraphicsManager.Current.Allocate (Board.CreateGraphics (), Board.DisplayRectangle);
|
||||||
|
|||||||
@@ -4,5 +4,7 @@ namespace WorldOfPeacecraft
|
|||||||
public interface IBackend
|
public interface IBackend
|
||||||
{
|
{
|
||||||
ITile[,] GetMap();
|
ITile[,] GetMap();
|
||||||
|
|
||||||
|
void Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace WorldOfPeacecraft
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
SenderThread.Abort();
|
SenderThread.Abort();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user