本文整理汇总了C#中UnloadEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# UnloadEventArgs类的具体用法?C# UnloadEventArgs怎么用?C# UnloadEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnloadEventArgs类属于命名空间,在下文中一共展示了UnloadEventArgs类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnUnload
private static void OnUnload(object sender, UnloadEventArgs unloadEventArgs)
{
try
{
_unloaded = true;
if (_sprite != null && !_sprite.IsDisposed)
{
_sprite.Dispose();
}
foreach (var font in Fonts.Where(font => font.Value != null && !font.Value.IsDisposed))
{
font.Value.Dispose();
}
foreach (var line in Lines.Where(line => line != null && !line.IsDisposed))
{
line.Dispose();
}
Drawing.OnPreReset -= OnDrawingPreReset;
Drawing.OnPostReset -= OnDrawingPostReset;
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
}
示例2: OnUnload
protected virtual void OnUnload(object sender, UnloadEventArgs args)
{
try
{
if (Unloaded)
{
return;
}
OnDisable();
if (args != null && args.Final)
{
Unloaded = true;
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
}
示例3: OnUnload
protected virtual void OnUnload(object sender, UnloadEventArgs args)
{
if (Unloaded)
{
return;
}
OnDisable();
if (args != null && args.Final)
{
Unloaded = true;
}
}