public PluginControl AddControl(Control c, string heading) { PluginControl control = this.Form.AddControl(c, heading); this._queryControl.OnPluginAdded(control); return(control); }
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(); } } }
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); } }
public void DisposeControl(PluginControl c) { PluginForm form = this.Form; if (form != null) { form.InvokeDisposeControl(c); } }
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); }
internal void Hide() { PluginForm form = this.Form; if (form != null) { this.Stop(); this._activeControl = null; form.InvokeHide(); } }
internal void OnInfoMessageChanged(PluginControl pic, string value) { try { if ((this._queryControl != null) && !this._queryControl.IsDisposed) { this._queryControl.OnInfoMessageChanged(pic, value); } } catch { } }
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); }
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); } }
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); }
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 RequestShow(PluginControl control) { this._queryControl.RequestPlugInShow(control); }
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(); } } }
internal void PluginJustAdded(PluginControl plugin) { this._queryControl.OnPluginAdded(plugin); }
internal OutputPanel(PluginControl c) { this._pic = c; }
internal void OnInfoMessageChanged(PluginControl pic, string value) { this._manager.OnInfoMessageChanged(pic, value); }
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(); } }
internal void OnPluginRemoved(PluginControl plugin) { this.RemovePluginWinButton(plugin); }
internal void OnPluginAdded(PluginControl c) { if (this._gotPluginsReadyMessage || this._query.MessageLoopStartedWithoutForm) { this.CreatePluginWinButton(c, true, true); this.UpdateOutputToolStripLayout(); } }
internal void OnInfoMessageChanged(PluginControl pic, string value) { if (this.GetSelectedPluginControl() == pic) { this.lblMiscStatus.Text = value; } }
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(); } }
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 { } } }
internal void InvokeDisposeControl(PluginControl c) { this.BeginInvoke(() => c.Control.Dispose()); }
internal void OnPluginRemoved(PluginControl pic) { this._queryControl.OnPluginRemoved(pic); }
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(); } }