-
Notifications
You must be signed in to change notification settings - Fork 0
/
FormBase.cs
38 lines (34 loc) · 859 Bytes
/
FormBase.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Suconbu.Toolbox;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
namespace Suconbu.Sumacon
{
public class FormBase : DockContent
{
bool formClosed = false;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Util.TraverseControls(this, c => c.Font = SystemFonts.MessageBoxFont);
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
this.formClosed = true;
}
protected void SafeInvoke(MethodInvoker action)
{
try
{
if (!this.formClosed) this.Invoke(action);
}
catch(Exception)
{
;
}
}
}
}