public void Initialize(IPluginContext2 context) { _Context = context; _ExportQueriesButton = (_Context.MainMenu.Items["MMTools"] as ToolStripDropDownButton) .DropDownItems.Add("Export Selected Queries") as ToolStripMenuItem; _QueriesWindow = _Context.SystemWindows .Where <ISystemWindow>(w => w.Text == "Queries") .FirstOrDefault(); _ExportQueriesButton.Click += _ExportQueriesButton_Click; }
public void Initialize(IPluginContext2 context) { //Save the plugin context so we can access ASE objects later this._Context = context; ToolStripButton btn = new ToolStripButton("Open ASE Editor"); this._Context.MainMenu.Items.Add(btn); btn.Click += btn_Click; this._CodeWindow = new ASECodeEditorWindow(); this._CodeWindow.PluginContext = context; this._CodeWindow.Show(this._Context.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockRight); }
private void InitPluginContext(IPluginContext2 pluginContext) { if (this._IsInit) { return; } this._PluginContext = pluginContext; this.db = (dao.Database) NetOffice.Factory.CreateKnownObjectFromComProxy( null, this.PluginContext.Database.CurrentDb(), typeof(dao.Database)); this.PopulateTableDropdown(); this._IsInit = true; }
public void Initialize(IPluginContext2 context) { _PluginContext = context; _QueriesWindow = _PluginContext.SystemWindows .Where <ISystemWindow>(w => w.Text == "Queries") .Select <ISystemWindow, TreeView>(item => (TreeView)item) .FirstOrDefault(); _TablesWindow = _PluginContext.SystemWindows .Where <ISystemWindow>(w => w.Text == "Tables") .Select <ISystemWindow, TreeView>(item => (TreeView)item) .FirstOrDefault(); var treeViewType = typeof(TreeView); var propertyInfo = treeViewType.GetField("ItemsContextMenu", BindingFlags.Instance | BindingFlags.NonPublic); _QueriesContextMenu = (ContextMenuStrip)propertyInfo.GetValue(_QueriesWindow); _TablesContextMenu = (ContextMenuStrip)propertyInfo.GetValue(_TablesWindow); var queriesMenuItem = AddContextMenuItem(_QueriesContextMenu); var tablesMenuItem = AddContextMenuItem(_TablesContextMenu); CancelEventHandler contextMenuOpening = (s, e) => { ContextMenuStrip menuStrip = (ContextMenuStrip)s; TreeView srcView = GetFormFromMenu(menuStrip); string connectionString = SelectedNodeConnectionString(srcView); queriesMenuItem.Enabled = !String.IsNullOrWhiteSpace(connectionString); tablesMenuItem.Enabled = !String.IsNullOrWhiteSpace(connectionString); }; _QueriesContextMenu.Opening += contextMenuOpening; _TablesContextMenu.Opening += contextMenuOpening; }
public void Unload() { _ExportQueriesButton.Dispose(); _Context = null; }
public void Unload() { _PluginContext = null; }
private void InitPluginContext(IPluginContext2 pluginContext) { if (this._IsInit) return; this._PluginContext = pluginContext; this.db = (dao.Database) NetOffice.Factory.CreateKnownObjectFromComProxy( null, this.PluginContext.Database.CurrentDb(), typeof(dao.Database)); this.PopulateTableDropdown(); this._IsInit = true; }
public void Unload() { m_Ctxt = null; }
public void Initialize(IPluginContext2 context) { m_Ctxt = context; m_Ctxt.DockPanel.ContentAdded += DockPanel_ContentAdded; }