public static void Init(PluginHost ppHost, delMyError pErrorFunc) { if (!Shutdown) { return; } Shutdown = false; pHost = ppHost; iErrorFunc = pErrorFunc; iFrameNum = 0; iLoginNum++; pHost.Underlying.Hooks.RenderPreUI += new Decal.Interop.Core.IACHooksEvents_RenderPreUIEventHandler(hooks_RenderPreUI); CoreManager.Current.PluginTermComplete += new EventHandler <EventArgs>(Current_PluginTermComplete); }
static void Current_PluginTermComplete(object sender, EventArgs e) { Shutdown = true; List <MyTimer> displist = new List <MyTimer>(); foreach (MyTimer t in timers) { displist.Add(t); } foreach (MyTimer t in displist) { t.Dispose(); } timers.Clear(); //pHost.Underlying.Hooks.RenderPreUI -= new Decal.Interop.Core.IACHooksEvents_RenderPreUIEventHandler(hooks_RenderPreUI); CoreManager.Current.PluginTermComplete -= new EventHandler <EventArgs>(Current_PluginTermComplete); pHost = null; iErrorFunc = null; }