public void Reset(bool delayClose)
        {
            Action close;

            this.Stop();
            PluginForm form = this.Form;

            if (form != null)
            {
                this.Form           = null;
                this._activeControl = null;
                close = delegate {
                    try
                    {
                        form.InvokeCloseWithShutdown();
                    }
                    catch
                    {
                    }
                };
                if (delayClose)
                {
                    ThreadPool.QueueUserWorkItem(delegate(object _) {
                        Thread.Sleep(0x3e8);
                        close();
                    });
                }
                else
                {
                    close();
                }
            }
        }
        public void DisposeControl(PluginControl c)
        {
            PluginForm form = this.Form;

            if (form != null)
            {
                form.InvokeDisposeControl(c);
            }
        }
        internal void Relocate(Rectangle rectangle)
        {
            PluginForm form = this.Form;

            if (form != null)
            {
                form.InvokeRelocate(rectangle);
            }
        }
        internal void Hide()
        {
            PluginForm form = this.Form;

            if (form != null)
            {
                this.Stop();
                this._activeControl = null;
                form.InvokeHide();
            }
        }
 internal void OnInfoMessageChanged(string value)
 {
     this.InfoMessage = value;
     if ((this.Control != null) && !this.Control.IsDisposed)
     {
         PluginForm form = this.Control.FindForm() as PluginForm;
         if (form != null)
         {
             form.OnInfoMessageChanged(this, value);
         }
     }
 }
        internal void Show(PluginControl control, bool focus)
        {
            bool clickTransparencySupported = (Program.TransparencyKey.R == Program.TransparencyKey.G) && (Program.TransparencyKey.R == Program.TransparencyKey.B);

            if ((Environment.OSVersion.Version.Major == 5) && (Screen.PrimaryScreen.BitsPerPixel == 0x20))
            {
                clickTransparencySupported = false;
            }
            this.RequestRelocation(this.Form);
            PluginForm form = this.Form;

            if (form != null)
            {
                this._activeControl = control;
                this.Start();
                form.InvokeShow(this._activeControl, this.ApplicationFormHandle, MainForm.Instance.HandleThreadsafe, focus, clickTransparencySupported);
            }
        }
 private void UpdateVisibility()
 {
     if (MainForm.Instance != null)
     {
         PluginForm form = this.Form;
         if (MainForm.Instance.WindowState == FormWindowState.Minimized)
         {
             if ((form != null) && form.ThreadSafeVisible)
             {
                 this.Form.InvokeHideIfVisible();
             }
         }
         else if ((form != null) && ((MainForm.Instance.IsAppActive || MainForm.Instance.IsActive) || MainForm.Instance.ResultsDockForm.IsActive))
         {
             if (MainForm.Instance.IsSplitting)
             {
                 MainForm.Instance.BeginInvoke(delegate {
                     MainForm.Instance.TopMost = true;
                     MainForm.Instance.TopMost = false;
                 });
             }
             else
             {
                 try
                 {
                     if ((MainForm.Instance.CurrentQueryControl != this._queryControl) || (this._activeControl == null))
                     {
                         form.InvokeHideIfVisible();
                     }
                     else
                     {
                         form.InvokeSetZOrder(this.ApplicationFormHandle, MainForm.Instance.HandleThreadsafe);
                     }
                 }
                 catch (AppDomainUnloadedException)
                 {
                     this.Dispose();
                 }
             }
         }
     }
 }
 internal void OnPluginFormClosed(PluginForm pluginForm)
 {
     if ((this._queryControl != null) && !this._queryControl.IsDisposed)
     {
         Action method = delegate {
             if (pluginForm == this.Form)
             {
                 this.Stop();
                 this.Form           = null;
                 this._activeControl = null;
                 this._queryControl.OnAllPluginsRemoved();
             }
         };
         if (this._queryControl.InvokeRequired)
         {
             this._queryControl.BeginInvoke(method);
         }
         else
         {
             method();
         }
     }
 }
 internal void RequestRelocation(PluginForm pluginForm)
 {
     this._queryControl.RequestWinManagerRelocation();
 }