Exemple #1
0
        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);
        }
        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);
        }
Exemple #4
0
        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;
        }
Exemple #5
0
        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;
        }
Exemple #6
0
 public void Unload()
 {
     _ExportQueriesButton.Dispose();
     _Context = null;
 }
Exemple #7
0
 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;
        }
Exemple #9
0
 public void Unload()
 {
     m_Ctxt = null;
 }
Exemple #10
0
 public void Initialize(IPluginContext2 context)
 {
     m_Ctxt = context;
     m_Ctxt.DockPanel.ContentAdded += DockPanel_ContentAdded;
 }