コード例 #1
0
        public PluginControl AddControl(Control c, string heading)
        {
            PluginControl control = this.Form.AddControl(c, heading);

            this._queryControl.OnPluginAdded(control);
            return(control);
        }
コード例 #2
0
        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();
                }
            }
        }
コード例 #3
0
ファイル: PluginForm.cs プロジェクト: rajeshwarn/TestProject
        internal void InvokeShow(PluginControl plugin, IntPtr parentHandle, IntPtr mainFormHandle, bool focus, bool clickTransparencySupported)
        {
            this._clickTransparencySupported = clickTransparencySupported && !LocalUserOptions.Instance.PluginsOnTop;
            Action a = delegate {
                if (!this.Visible)
                {
                    this.ShowNoActivate();
                }
                this._shouldBeVisible = true;
                this.SetZOrder(parentHandle, mainFormHandle);
                Control[] controlArray = (from c in this.Controls.Cast <Control>()
                                          where (c != plugin.Control) && c.Visible
                                          select c).ToArray <Control>();
                plugin.Control.Visible = true;
                foreach (Control control in controlArray)
                {
                    control.Hide();
                }
                if (focus)
                {
                    this.Activate();
                    plugin.Control.Focus();
                }
            };

            if (this._shown)
            {
                this.BeginInvoke(a);
            }
            else
            {
                Server.CurrentServer.RunOnMessageLoopThread(a);
            }
        }
コード例 #4
0
 public void DisposeControl(PluginControl c)
 {
     PluginForm form = this.Form;
     if (form != null)
     {
         form.InvokeDisposeControl(c);
     }
 }
コード例 #5
0
        public void DisposeControl(PluginControl c)
        {
            PluginForm form = this.Form;

            if (form != null)
            {
                form.InvokeDisposeControl(c);
            }
        }
コード例 #6
0
ファイル: PluginForm.cs プロジェクト: rajeshwarn/TestProject
 protected override void OnControlRemoved(ControlEventArgs e)
 {
     if (this._controls.Contains(e.Control))
     {
         PluginControl item = this._controls[e.Control];
         this._controls.Remove(item);
         this._manager.OnPluginRemoved(item);
     }
     base.OnControlRemoved(e);
 }
コード例 #7
0
        internal void Hide()
        {
            PluginForm form = this.Form;

            if (form != null)
            {
                this.Stop();
                this._activeControl = null;
                form.InvokeHide();
            }
        }
コード例 #8
0
 internal void OnInfoMessageChanged(PluginControl pic, string value)
 {
     try
     {
         if ((this._queryControl != null) && !this._queryControl.IsDisposed)
         {
             this._queryControl.OnInfoMessageChanged(pic, value);
         }
     }
     catch
     {
     }
 }
コード例 #9
0
ファイル: PluginForm.cs プロジェクト: rajeshwarn/TestProject
        public PluginControl AddControl(Control c, string heading)
        {
            PluginControl item = new PluginControl(c, heading);

            this._controls.Add(item);
            c.Dock    = DockStyle.Fill;
            c.Visible = false;
            if (base.InvokeRequired)
            {
                this.BeginInvoke(delegate {
                    this.Controls.Add(c);
                });
                return(item);
            }
            base.Controls.Add(c);
            return(item);
        }
コード例 #10
0
        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);
            }
        }
コード例 #11
0
        public static PluginControl AddControl(Control c, string heading)
        {
            Server currentServer = Server.CurrentServer;

            if (currentServer == null)
            {
                return(null);
            }
            PluginWindowManager pluginWindowManager = currentServer.PluginWindowManager;

            if (pluginWindowManager == null)
            {
                return(null);
            }
            bool flag = false;

            if (pluginWindowManager.Form == null)
            {
                flag = true;
                pluginWindowManager.Form = new PluginForm(pluginWindowManager);
            }
            if (string.IsNullOrEmpty(heading))
            {
                heading = "Custom" + ((CustomCount == 1) ? "" : (" " + CustomCount));
                if (CustomCount == 1)
                {
                    heading = "&" + heading;
                }
                CustomCount++;
            }
            PluginControl plugin = pluginWindowManager.Form.AddControl(c, heading);

            if (flag)
            {
                currentServer.NotifyPluginFormCreated(pluginWindowManager.Form);
            }
            pluginWindowManager.PluginJustAdded(plugin);
            return(plugin);
        }
コード例 #12
0
 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();
         }
     }
 }
コード例 #13
0
 internal void RequestShow(PluginControl control)
 {
     this._queryControl.RequestPlugInShow(control);
 }
コード例 #14
0
 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);
     }
 }
コード例 #15
0
 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();
         }
     }
 }
コード例 #16
0
 internal void RequestShow(PluginControl control)
 {
     this._queryControl.RequestPlugInShow(control);
 }
コード例 #17
0
 internal void PluginJustAdded(PluginControl plugin)
 {
     this._queryControl.OnPluginAdded(plugin);
 }
コード例 #18
0
 internal OutputPanel(PluginControl c)
 {
     this._pic = c;
 }
コード例 #19
0
ファイル: PluginForm.cs プロジェクト: rajeshwarn/TestProject
 internal void OnInfoMessageChanged(PluginControl pic, string value)
 {
     this._manager.OnInfoMessageChanged(pic, value);
 }
コード例 #20
0
 internal void PluginJustAdded(PluginControl plugin)
 {
     this._queryControl.OnPluginAdded(plugin);
 }
コード例 #21
0
 internal void Hide()
 {
     PluginForm form = this.Form;
     if (form != null)
     {
         this.Stop();
         this._activeControl = null;
         form.InvokeHide();
     }
 }
コード例 #22
0
 internal void RequestPlugInShow(PluginControl c)
 {
     Action a = delegate {
         if ((!this.IsDisposed && (MainForm.Instance != null)) && (MainForm.Instance.CurrentQueryControl == this))
         {
             ToolStripButton selectedButton = this._pluginWinButtons.FirstOrDefault<ToolStripButton>(b => b.Tag == c);
             if (selectedButton != null)
             {
                 this.SelectOutputPanel(selectedButton, false);
             }
         }
     };
     if (base.InvokeRequired)
     {
         this.BeginInvoke(a);
     }
     else
     {
         a();
     }
 }
コード例 #23
0
 internal void OnPluginRemoved(PluginControl plugin)
 {
     this.RemovePluginWinButton(plugin);
 }
コード例 #24
0
 internal void OnPluginAdded(PluginControl c)
 {
     if (this._gotPluginsReadyMessage || this._query.MessageLoopStartedWithoutForm)
     {
         this.CreatePluginWinButton(c, true, true);
         this.UpdateOutputToolStripLayout();
     }
 }
コード例 #25
0
 internal void OnInfoMessageChanged(PluginControl pic, string value)
 {
     if (this.GetSelectedPluginControl() == pic)
     {
         this.lblMiscStatus.Text = value;
     }
 }
コード例 #26
0
 private void CreatePluginWinButton(PluginControl c, bool activate, bool afterCurrent)
 {
     Action a = delegate {
         if (!this._pluginWinButtons.Any<ToolStripButton>(b => (b.Tag == c)))
         {
             bool flag = !MainForm.Instance.IsActive && !MainForm.Instance.ResultsDockForm.IsActive;
             ToolStripButton button = new ToolStripButton(c.Heading) {
                 DisplayStyle = ToolStripItemDisplayStyle.Text,
                 Margin = new Padding(0, 0, 0, 1),
                 Tag = c,
                 ToolTipText = c.ToolTipText
             };
             button.Click += delegate (object sender, EventArgs e) {
                 if (Control.ModifierKeys == Keys.Control)
                 {
                     this.CloseVisualizer(c);
                 }
                 else
                 {
                     this.SelectOutputPanel(button, true);
                 }
             };
             button.MouseEnter += delegate (object sender, EventArgs e) {
                 this.tsOutput.Cursor = Cursors.Default;
                 try
                 {
                     button.ToolTipText = c.ToolTipText;
                     bool isActive = MainForm.Instance.IsActive;
                     if (!(string.IsNullOrEmpty(button.ToolTipText) || isActive))
                     {
                         this._pluginWinManager.ShowToolTip(button.ToolTipText);
                     }
                 }
                 catch
                 {
                 }
             };
             button.MouseLeave += delegate (object sender, EventArgs e) {
                 if (!(string.IsNullOrEmpty(c.ToolTipText) || MainForm.Instance.IsActive))
                 {
                     this._pluginWinManager.ShowToolTip(null);
                 }
             };
             button.MouseDown += delegate (object sender, MouseEventArgs e) {
                 if (e.Button == MouseButtons.Middle)
                 {
                     this.CloseVisualizer(c);
                 }
                 else if (e.Button == MouseButtons.Right)
                 {
                     this.SelectOutputPanel(button, false);
                     Point p = this.tsOutput.PointToScreen(e.Location);
                     p.Offset(button.Bounds.Location);
                     Program.RunOnWinFormsTimer(delegate {
                         this.FocusQueryExplicit();
                         this._pluginWinButtonMenu.Show(p);
                     }, 50);
                 }
             };
             if ((afterCurrent && this.IsPluginSelected()) && flag)
             {
                 int index = this._pluginWinButtons.IndexOf(this.GetSelectedPanelButton());
                 this._pluginWinButtons.Insert(index + 1, button);
                 this.tsOutput.Items.Insert(index + 3, button);
             }
             else
             {
                 this._pluginWinButtons.Add(button);
                 this.tsOutput.Items.Insert(this.tsOutput.Items.IndexOf(this.btnLambda), button);
             }
             if (activate)
             {
                 this.SelectOutputPanel(button, false);
             }
         }
     };
     if (base.InvokeRequired)
     {
         this.BeginInvoke(a);
     }
     else
     {
         a();
     }
 }
コード例 #27
0
 internal void CloseVisualizer(PluginControl c)
 {
     if (c != null)
     {
         ToolStripButton button = (this.GetSelectedPluginControl() == c) ? this._pluginWinButtons.FirstOrDefault<ToolStripButton>(b => (b.Tag == c)) : null;
         int num = (button == null) ? -1 : this.tsOutput.Items.IndexOf(button);
         ToolStripButton selectedButton = (num < 1) ? null : (this.tsOutput.Items[num - 1] as ToolStripButton);
         try
         {
             this._pluginWinManager.DisposeControl(c);
             if (selectedButton != null)
             {
                 this.SelectOutputPanel(selectedButton, false);
             }
         }
         catch
         {
         }
     }
 }
コード例 #28
0
ファイル: PluginForm.cs プロジェクト: rajeshwarn/TestProject
 internal void InvokeDisposeControl(PluginControl c)
 {
     this.BeginInvoke(() => c.Control.Dispose());
 }
コード例 #29
0
 internal void OnInfoMessageChanged(PluginControl pic, string value)
 {
     try
     {
         if ((this._queryControl != null) && !this._queryControl.IsDisposed)
         {
             this._queryControl.OnInfoMessageChanged(pic, value);
         }
     }
     catch
     {
     }
 }
コード例 #30
0
 internal void OnPluginRemoved(PluginControl pic)
 {
     this._queryControl.OnPluginRemoved(pic);
 }
コード例 #31
0
 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();
         }
     }
 }
コード例 #32
0
 private void RemovePluginWinButton(PluginControl pluginControl)
 {
     Action a = delegate {
         ToolStripButton button = this._pluginWinButtons.FirstOrDefault<ToolStripButton>(b => b.Tag == pluginControl);
         if (button != null)
         {
             bool flag = button.Checked;
             this.tsOutput.Items.Remove(button);
             this._pluginWinButtons.Remove(button);
             if (flag)
             {
                 this.SelectResultsPanel(false);
             }
         }
     };
     if (base.InvokeRequired)
     {
         this.BeginInvoke(a);
     }
     else
     {
         a();
     }
 }
コード例 #33
0
 internal void OnPluginRemoved(PluginControl pic)
 {
     this._queryControl.OnPluginRemoved(pic);
 }