コード例 #1
0
 public OneToManyCustomTaskPaneAdapter(CustomTaskPane original, object viewContext)
 {
     ViewContext = viewContext;
     this.original = original;
     customTaskPanes = new List<CustomTaskPane>();
     Add(original);
 }
コード例 #2
0
 /// <summary>
 /// 생성자
 /// </summary>
 /// <param name="Inspector"></param>
 public InspectorWrapper(Outlook.Inspector Inspector)
 {
     inspector = Inspector;
     ((Outlook.InspectorEvents_Event)inspector).Close += new Outlook.InspectorEvents_CloseEventHandler(InspectorWrapper_Close);
     taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(new EmailTreeControll(), "for Wylie", inspector);
     taskPane.VisibleChanged += new EventHandler(TaskPane_VisibleChanged);
 }
コード例 #3
0
ファイル: ThisAddIn.cs プロジェクト: kahn520/App
 private void ThisAddIn_Startup(object sender, System.EventArgs e)
 {
     Globals.ThisAddIn.Application.WindowSelectionChange += Application_WindowSelectionChange;
     paneInfo = new PaneShapeInfo();
     pane = Globals.ThisAddIn.CustomTaskPanes.Add(paneInfo, "形状信息");
     pane.Visible = true;
 }
コード例 #4
0
ファイル: ExplorerWrapper.cs プロジェクト: hasnain2663/spikes
        public ExplorerWrapper(Explorer explorer)
        {
            _explorer = explorer;
            ((ExplorerEvents_Event)_explorer).Close += ExplorerWrapper_Close;

            taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(new TaskPaneControl("Explorer", _count++), "My task pane", _explorer);
            taskPane.VisibleChanged += TaskPane_VisibleChanged;
        }
コード例 #5
0
        public InspectorWrapper(Inspector Inspector)
        {
            inspector = Inspector;
            ((InspectorEvents_Event)inspector).Close += InspectorWrapper_Close;

            taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(new TaskPaneControl("Inspector", _count++), "My task pane", inspector);
            taskPane.VisibleChanged += TaskPane_VisibleChanged;
            taskPane.Visible = true;
        }
コード例 #6
0
 public static void DeleteCTP()
 {
     if (ctp != null)
     {
         // Could hide instead, by calling ctp.Visible = false;
         ctp.Delete();
         ctp = null;
     }
 }
コード例 #7
0
ファイル: ThisAddIn.cs プロジェクト: samadm/ReportGenerator
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            Application.PresentationBeforeClose += Application_PresentationBeforeClose;

            tp = new TaskPane();
            ctp = this.CustomTaskPanes.Add(tp, Properties.Resources.TaskPaneTitle);
            ctp.Width = 300;

            ctp.VisibleChanged += new EventHandler(ctp_VisibleChanged);
        }
コード例 #8
0
ファイル: ThisAddIn.cs プロジェクト: Garnel/Wexcel
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            taskPaneView = new Details();
            taskPane = this.CustomTaskPanes.Add(taskPaneView, "微博");
            taskPane.Width = 300;
            taskPane.Visible = false;

            t.Elapsed += new System.Timers.ElapsedEventHandler(WexcelNotificate);
            t.AutoReset = true;
            t.Enabled = false;
        }
コード例 #9
0
        /// <summary>
        /// 창을 닫을때 inspector를 초기화
        /// </summary>
        private void InspectorWrapper_Close()
        {
            if (taskPane != null)
            {
                Globals.ThisAddIn.CustomTaskPanes.Remove(taskPane);
            }

            taskPane = null;
            Globals.ThisAddIn.InspectorWrappers.Remove(inspector);
            ((Outlook.InspectorEvents_Event)inspector).Close -= new Outlook.InspectorEvents_CloseEventHandler(InspectorWrapper_Close);
            inspector = null;
        }
コード例 #10
0
 private void ShowActivitiesCTP()
 {
     if (TaskPane == null)
     {
         TaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(new WorkflowActivitiesControl(), "Workflow Activity Tracking");
         TaskPane.Visible = true;
     }
     else
     {
         TaskPane.Visible = true;
     }
 }
コード例 #11
0
ファイル: ExplorerWrapper.cs プロジェクト: hasnain2663/spikes
        private void ExplorerWrapper_Close()
        {
            if (taskPane != null)
            {
                Globals.ThisAddIn.CustomTaskPanes.Remove(taskPane);
            }

            taskPane = null;
            Globals.ThisAddIn.ExplorerWrappers.Remove(_explorer);

            ((ExplorerEvents_Event)_explorer).Close -= ExplorerWrapper_Close;

            _explorer = null;
        }
コード例 #12
0
 private void RemoveOrphanedTaskPanes()
 {
     try
     {
         for (int i = this.CustomTaskPanes.Count; i > 0; i--)
         {
             CustomTaskPane ctp = this.CustomTaskPanes[i - 1];
             if (ctp.Window == null)
             {
                 this.CustomTaskPanes.Remove(ctp);
             }
         }
     }
     catch { }
 }
コード例 #13
0
        protected override void InitializeShell()
        {
            base.InitializeShell();

            //set current culture
            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement),
                                                               new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            mainRibbon.setController(this.Kernel.Get <IRibbonController>());

            CustomTaskPane mainTaskPane = this.Kernel.Get <CustomTaskPane>();

            mainTaskPane.Visible = true;
            Application app = Application.Current;
        }
コード例 #14
0
        public CustomTaskPane ShowTaskPane()
        {
            if (!Globals.ThisAddIn.CustomTaskPanes.Any())
            {
                var service = new DocumentSerivce(Globals.ThisAddIn.Application.ActiveDocument);
                _mistakesListVM = new MistakesListViewModel(service, _spellChecker);
                var control = new WpfHost();
                control.Host.Child = new MistakesList(_mistakesListVM);
                _taskPane          = Globals.ThisAddIn.CustomTaskPanes.Add(control, "Kurdspell");
            }

            _taskPane.Visible = true;

            return(_taskPane);
        }
コード例 #15
0
 /// <summary>
 /// 显示读取SAP表数据的控件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tgbtnShowReadTable_Click(object sender, RibbonControlEventArgs e)
 {
     if (_ReaTablePane == null)
     {
         _ReadTableControl             = new ReadTableControl();
         _ReaTablePane                 = Globals.ThisAddIn.CustomTaskPanes.Add(_ReadTableControl, "读取SAP表内容");
         _ReaTablePane.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged);
         _ReaTablePane.Visible         = true;
         _ReaTablePane.Width           = 300;
     }
     else
     {
         _ReaTablePane.Visible = ((RibbonToggleButton)sender).Checked;
     }
 }
コード例 #16
0
 private void btnGetTableInfo_Click(object sender, RibbonControlEventArgs e)
 {
     if (_GetTableMetaPane == null)
     {
         _GetTableMetaControl              = new GetTableMetaControl();
         _GetTableMetaPane                 = Globals.ThisAddIn.CustomTaskPanes.Add(_GetTableMetaControl, "读取SAP表元数据");
         _GetTableMetaPane.VisibleChanged += new EventHandler(getTaBleMetaPane_VisibleChanged);
         _GetTableMetaPane.Visible         = true;
         _GetTableMetaPane.Width           = 300;
     }
     else
     {
         _GetTableMetaPane.Visible = ((RibbonToggleButton)sender).Checked;
     }
 }
コード例 #17
0
ファイル: ThisAddIn.cs プロジェクト: drhoet/LanguageTools
        private void InstantLookup_OnLemmaFound(object sender, List <Noun> found, MSWord.Document document)
        {
            CustomTaskPane ctp = null;

            taskPaneMap.TryGetValue(document, out ctp);
            if (ctp != null)
            {
                LookupPane lookupPane = (LookupPane)ctp.Control;
                lookupPane.Invoke((Action) delegate
                {
                    lookupPane.Item = found[0];
                    lookupPane.lbxResults.DataSource = found;
                });
            }
        }
コード例 #18
0
 /// <summary>
 /// 显示SAP Query控件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tgbtnQuery_Click(object sender, RibbonControlEventArgs e)
 {
     if (_SapQueryPane == null)
     {
         _SAPQueryControl              = new SAPQueryControl();
         _SapQueryPane                 = Globals.ThisAddIn.CustomTaskPanes.Add(_SAPQueryControl, "SAP Query");
         _SapQueryPane.DockPosition    = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionBottom;
         _SapQueryPane.VisibleChanged += new System.EventHandler(_SapQueryPane_VisibleChanged);
         _SapQueryPane.Visible         = true;
     }
     else
     {
         _SapQueryPane.Visible = ((RibbonToggleButton)sender).Checked;
     }
 }
コード例 #19
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            processingUtility        = new MailProcessingUtilities();
            inspectors               = this.Application.Inspectors;
            inspectors.NewInspector +=
                new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);

            foreach (Outlook.Inspector inspector in inspectors)
            {
                Inspectors_NewInspector(inspector);
            }

            tagManagementControl  = new TagManagementControl();
            tagManagementTaskPane = this.CustomTaskPanes.Add(tagManagementControl, global::CELA_Email_Tags_Outlook_Plugin.CELA_Custom_Ribbon.tagManagmentDisplayPanelTitleText);
        }
コード例 #20
0
 private void ThisAddIn_Startup(object sender, System.EventArgs e)
 {
     m_control.AutoSize = true;
     m_panel = CustomTaskPanes.Add(m_control, "Cell Art");
     m_panel.Width = m_control.PreferredSize.Width + 10;
     m_panel.VisibleChanged += (snd, ev) =>
     {
         var r = Globals.Ribbons.GetRibbon(typeof(MyRibbon));
         var ribbon = r as MyRibbon;
         if (ribbon != null)
         {
             ribbon.ChangeStatus(m_panel.Visible);
         }
     };
 }
コード例 #21
0
        protected override void ExecuteAction(string ribbonId)
        {
            LoadingDialogBox splashView = new LoadingDialogBox();

            splashView.Show();
            AzureAccountStorageService.LoadUserAccount();
            WatsonAccountStorageService.LoadUserAccount();
            AudioSettingStorageService.LoadAudioSettingPreference();
            splashView.Close();
            this.RegisterTaskPane(typeof(ELearningLabTaskpane), ELearningLabText.ELearningTaskPaneLabel,
                                  ELearningTaskPaneVisibleValueChangedEventHandler);
            CustomTaskPane eLearningTaskpane = this.GetTaskPane(typeof(ELearningLabTaskpane));

            eLearningTaskpane.Visible = !eLearningTaskpane.Visible;
        }
コード例 #22
0
 public static void ShowCTP()
 {
     if (ctp == null)
     {
         // Make a new one using ExcelDna.Integration.CustomUI.CustomTaskPaneFactory
         ctp              = CustomTaskPaneFactory.CreateCustomTaskPane(typeof(HelpSideBarControl), SwaggerRegistry.Api.Info.Title);
         ctp.Visible      = true;
         ctp.DockPosition = MsoCTPDockPosition.msoCTPDockPositionRight;
     }
     else
     {
         // Just show it again
         ctp.Visible = true;
     }
 }
コード例 #23
0
 private void ListCaptionsForTaskPaneWindows(String context)
 {
     try
     {
         for (int i = this.CustomTaskPanes.Count; i > 0; i--)
         {
             CustomTaskPane ctp       = this.CustomTaskPanes[i - 1];
             Word.Window    ctpWindow = (Word.Window)ctp.Window;
             System.Diagnostics.Debug.Write(context + "   i " + i + " tcp WindowCaption: " + ctpWindow.Caption + "\n");
         }
     }
     catch (Exception ex)
     {
     }
 }
コード例 #24
0
        private void open_DbfExportTaskPane(object sender, RibbonControlEventArgs e)
        {
            if (ucDbfExport == null)
            {
                ucDbfExport = new UC_DbfExport();
            }

            if (ucDbfCustomTaskPane == null)
            {
                ucDbfCustomTaskPane       = Globals.ThisAddIn.CustomTaskPanes.Add(ucDbfExport, "DBF导出任务");
                ucDbfCustomTaskPane.Width = 300;
            }

            ucDbfCustomTaskPane.Visible = !ucDbfCustomTaskPane.Visible;
        }
コード例 #25
0
        public InspectorWrapper(MSOutlook.Inspector Inspector, InstantLookup<MSOutlook.Inspector> InstantLookup)
        {
            inspector = Inspector;
            ((MSOutlook.InspectorEvents_Event)inspector).Activate += InspectorWrapper_Activate;
            ((MSOutlook.InspectorEvents_Event)inspector).Deactivate += InspectorWrapper_Deactivate;
            ((MSOutlook.InspectorEvents_Event)inspector).Close += InspectorWrapper_Close;

            instantLookup = InstantLookup;
            instantLookup.OnLemmaFound += InstantLookup_OnLemmaFound;

            taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(new LookupPane(), "German Grammar", inspector);
            taskPane.Visible = Properties.Settings.Default.LookupPaneVisible;
            taskPane.Width = Properties.Settings.Default.LookupPaneWidth;
            taskPane.Control.Tag = taskPane;
            taskPane.Control.SizeChanged += Control_SizeChanged;
        }
コード例 #26
0
 public static void ShowCTP()
 {
     //Office 2013 is SDI(single document interface) https://www.add-in-express.com/creating-addins-blog/2013/02/28/excel2013-single-document-interface-task-panes/
     if (ctp == null)
     {
         ctp = CustomTaskPaneFactory.CreateCustomTaskPane(typeof(CTPControls), "Custom CTP");
         ctp.DockPosition             = MsoCTPDockPosition.msoCTPDockPositionRight;
         ctp.DockPositionStateChange += ctp_DockPositionStateChange;
         ctp.VisibleStateChange      += ctp_VisibleStateChange;
         ctp.Visible = true;
     }
     else
     {
         ctp.Visible = true;
     }
 }
コード例 #27
0
        private void btnGetTableInfo_Click(object sender, RibbonControlEventArgs e)
        {
            if (_GetTableMetaPane == null)
            {
                _GetTableMetaControl = new GetTableMetaControl();
                _GetTableMetaPane = Globals.ThisAddIn.CustomTaskPanes.Add(_GetTableMetaControl, "读取SAP表元数据");
                _GetTableMetaPane.VisibleChanged += new EventHandler(getTaBleMetaPane_VisibleChanged);
                _GetTableMetaPane.Visible = true;
                _GetTableMetaPane.Width = 300;
            }
            else
            {
                _GetTableMetaPane.Visible = ((RibbonToggleButton)sender).Checked;

            }
        }
コード例 #28
0
        protected override void ExecuteAction(string ribbonId)
        {
            this.RegisterTaskPane(typeof(PositionsPane), PositionsLabText.TaskPanelTitle);
            CustomTaskPane positionsPane = this.GetTaskPane(typeof(PositionsPane));

            // if currently the pane is hidden, show the pane
            if (!positionsPane.Visible)
            {
                // fire the pane visble change event
                positionsPane.Visible = true;
            }
            else
            {
                positionsPane.Visible = false;
            }
        }
コード例 #29
0
 private void EditAddressList()
 {
     if (addressEditorPane == null)
     {
         var paneManager = _serviceLocator.GetInstance <IPaneManager <CustomTaskPane> >();
         addressEditorPane = paneManager.CreateCustomTaskPane <AddressListView, AddressListViewModel>("Адрессный список");
         addressEditorPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionFloating;
         addressEditorPane.Width        = 600;
         addressEditorPane.Height       = 450;
         addressEditorPane.Visible      = true;
     }
     else
     {
         addressEditorPane.Visible = true;
     }
 }
コード例 #30
0
ファイル: ThisAddIn.cs プロジェクト: thexur/1code
 private void Inspectors_NewInspector(Outlook.Inspector inspector)
 {
     // We will add our custom task pane to the new inspector.
     if (inspector.CurrentItem is Outlook.MailItem ||
         inspector.CurrentItem is Outlook.AppointmentItem ||
         inspector.CurrentItem is Outlook.TaskItem ||
         inspector.CurrentItem is Outlook.ContactItem)
     {
         // Create the custom task pane and make it initially invisible.
         MyTaskPane     mtp = new MyTaskPane();
         CustomTaskPane ctp = this.CustomTaskPanes.Add(mtp, "Browser", inspector);
         ctp.Visible              = false;
         ctp.DockPosition         = Office.MsoCTPDockPosition.msoCTPDockPositionBottom;
         mtp.ParentCustomTaskPane = ctp;
     }
 }
コード例 #31
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            /*vlal20180323: Part1
             * var messageBox = MessageBox.Show("Hello, World!");
             */
            //vlal20180323: Part2
            var taskPaneView = new TaskPaneView();

            this.taskPane         = this.CustomTaskPanes.Add(taskPaneView, "VlalV");
            this.taskPane.Visible = false;

            var vlalViewModel = new VlalVViewModel();
            var vlalView      = taskPaneView.VlalVView;

            vlalView.DataContext = vlalViewModel;
        }
コード例 #32
0
        private void switchPanelTab_Click(object sender, RibbonControlEventArgs e)
        {
            CustomTaskPane customTaskPane = Globals.ThisAddIn.CustomTaskPane;

            customTaskPane.Visible = true;
            TabControl tabMainControl = (TabControl)customTaskPane.Control.Controls.Find("tabMainControl", true).FirstOrDefault();

            if (tabMainControl.SelectedIndex == 0)
            {
                tabMainControl.SelectTab(1);
            }
            else
            {
                tabMainControl.SelectTab(0);
            }
        }
コード例 #33
0
 private void EditRegexList()
 {
     if (regexEditorPane == null)
     {
         var paneManager = _serviceLocator.GetInstance <IPaneManager <CustomTaskPane> >();
         regexEditorPane = paneManager.CreateCustomTaskPane <RegexListView, RegexListViewModel>("Регулярные выражения");
         regexEditorPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionFloating;
         regexEditorPane.Width        = 600;
         regexEditorPane.Height       = 450;
         regexEditorPane.Visible      = true;
     }
     else
     {
         regexEditorPane.Visible = true;
     }
 }
コード例 #34
0
        public InspectorWrapper(MSOutlook.Inspector Inspector, InstantLookup <MSOutlook.Inspector> InstantLookup)
        {
            inspector = Inspector;
            ((MSOutlook.InspectorEvents_Event)inspector).Activate   += InspectorWrapper_Activate;
            ((MSOutlook.InspectorEvents_Event)inspector).Deactivate += InspectorWrapper_Deactivate;
            ((MSOutlook.InspectorEvents_Event)inspector).Close      += InspectorWrapper_Close;

            instantLookup = InstantLookup;
            instantLookup.OnLemmaFound += InstantLookup_OnLemmaFound;

            taskPane                      = Globals.ThisAddIn.CustomTaskPanes.Add(new LookupPane(), "German Grammar", inspector);
            taskPane.Visible              = Properties.Settings.Default.LookupPaneVisible;
            taskPane.Width                = Properties.Settings.Default.LookupPaneWidth;
            taskPane.Control.Tag          = taskPane;
            taskPane.Control.SizeChanged += Control_SizeChanged;
        }
コード例 #35
0
 public static void ShowCTP()
 {
     if (ctp == null)
     {
         // Make a new one using ExcelDna.Integration.CustomUI.CustomTaskPaneFactory
         ctp = CustomTaskPaneFactory.CreateCustomTaskPane(typeof(UserControlHost), "Corporate Header");
         ctp.DockPosition             = MsoCTPDockPosition.msoCTPDockPositionLeft;
         ctp.DockPositionStateChange += CTP_DockPositionStateChange;
         ctp.VisibleStateChange      += CTP_VisibleStateChange;
         ctp.Visible = true;
     }
     else
     {
         // Just show it again
         ctp.Visible = true;
     }
 }
コード例 #36
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            // 初始化右侧解析框
            UCForRichText richTextBox = new UCForRichText();
            _MyCustomTaskPane = this.CustomTaskPanes.Add(richTextBox, "解析结果");
            _MyCustomTaskPane.Width = 800;
            _MyCustomTaskPane.Visible = false;

            //获取右键菜单对象mzBar
            Office.CommandBar mzBar = Application.CommandBars["Text"];
            //重置菜单
            mzBar.Reset();
            //获取右键菜单的控制对象
            Office.CommandBarControls bars = mzBar.Controls;

            /*已被mzBar.Reset();替代,用于除去其余标签为"autoAnswer"的菜单项
            foreach (Office.CommandBarControl temp_contrl in bars)
            {
                string t = temp_contrl.Tag.Trim();
                if (t.Equals("autoAnswer"))
                {
                    temp_contrl.Delete();
                }
            }
            */

            //在右键菜单列表添加新的菜单项
            Office.CommandBarControl comControl = bars.Add(Office.MsoControlType.msoControlButton, missing, missing, missing, true); //添加自己的菜单项
            //将该菜单项转为按钮可点击模式
            Office.CommandBarButton comButton = comControl as Office.CommandBarButton;
            if (comControl != null)
            {
                comButton.Tag = "autoAnswer";//添加标签"autoAnswer"
                comButton.Caption = "选择答案";//设置文本
                comButton.Style = Office.MsoButtonStyle.msoButtonIconAndCaption;
                comButton.Enabled = false;//设置不可点击
                //name = comButton.accName;
                //comButton.Click += new Office._CommandBarButtonEvents_ClickEventHandler(_RightBtn_Click);

            }

            Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
            vstoDoc.BeforeDoubleClick += new Microsoft.Office.Tools.Word.ClickEventHandler(ThisDocument_BeforeDoubleClick);

            this.Application.WindowBeforeRightClick += new Word.ApplicationEvents4_WindowBeforeRightClickEventHandler(Application_WindowBeforeRightClick);
        }
コード例 #37
0
 public void UpdateCTP(List <string> names)
 {
     foreach (var i in DicCustomCTP.ToList())
     {
         CustomTaskPane ctp = DicCustomCTP[i.Key];
         CTPControl     uc  = null;
         try
         {
             uc = (CTPControl)ctp.ContentControl;
             uc.UpdateListView(names);
             uc.UpdateMessage(DicCustomCTP.Keys);
         }catch (Exception)
         {
             DicCustomCTP.Remove(i.Key);
         }
     }
 }
コード例 #38
0
        public void ShowSecKeyTaskPane(IRibbonControl control)
        {
            if (_secKeyTaskPane == null)
            {
                var secKeyLoader = new LoadSecKey();
                secKeyLoader.InitSecretarium(this);

                _secKeyTaskPane              = CustomTaskPaneFactory.CreateCustomTaskPane(secKeyLoader, "Secretarium");
                _secKeyTaskPane.Visible      = true;
                _secKeyTaskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionRight;
                _secKeyTaskPane.Width        = 500;
            }
            else
            {
                _secKeyTaskPane.Visible = true;
            }
        }
コード例 #39
0
        public void ShowX509TaskPane(IRibbonControl control)
        {
            if (_x509TaskPane == null)
            {
                var x509Loader = new LoadX509();
                x509Loader.InitSecretarium(this);

                _x509TaskPane              = CustomTaskPaneFactory.CreateCustomTaskPane(x509Loader, "Secretarium");
                _x509TaskPane.Visible      = true;
                _x509TaskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionRight;
                _x509TaskPane.Width        = 500;
            }
            else
            {
                _x509TaskPane.Visible = true;
            }
        }
コード例 #40
0
        private NotFoundViewModel OpenNotFoundPane()
        {
            if (notFoundPane != null)
            {
                notFoundPane.Visible = true;
            }
            else
            {
                var paneManager = _serviceLocator.GetInstance <IPaneManager <CustomTaskPane> >();
                notFoundPane = paneManager.CreateCustomTaskPane <NotFoundView, NotFoundViewModel>("Панель поиска");
                notFoundPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionLeft;
                notFoundPane.Width        = 800;
                notFoundPane.Visible      = true;
            }

            return(GetViewModelNotFoundPane());
        }
コード例 #41
0
 public static void ShowCTP()
 {
     if (ctp == null)
     {
         // Make a new one using ExcelDna.Integration.CustomUI.CustomTaskPaneFactory
         ctp                          = CustomTaskPaneFactory.CreateCustomTaskPane(typeof(CTP_rangeexport), "My Super Task Pane");
         ctp.Visible                  = true;
         ctp.DockPosition             = MsoCTPDockPosition.msoCTPDockPositionLeft;
         ctp.DockPositionStateChange += ctp_DockPositionStateChange;
         ctp.VisibleStateChange      += ctp_VisibleStateChange;
     }
     else
     {
         // Just show it again
         ctp.Visible = true;
     }
 }
コード例 #42
0
        public void ShowBase64KeysTaskPane(IRibbonControl control)
        {
            if (_keysTaskPane == null)
            {
                var keysLoader = new LoadKeys();
                keysLoader.InitSecretarium(this);

                _keysTaskPane              = CustomTaskPaneFactory.CreateCustomTaskPane(keysLoader, "Secretarium");
                _keysTaskPane.Visible      = true;
                _keysTaskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionRight;
                _keysTaskPane.Width        = 500;
            }
            else
            {
                _keysTaskPane.Visible = true;
            }
        }
コード例 #43
0
        private void AddAllTaskPanes()
        {
            foreach (Word.Window window in this.Application.Windows)
            {
                CustomTaskPane ctp = this.CustomTaskPanes.SingleOrDefault(t => t.Window == window);
                if (ctp == null)
                {
                    WordConnectorPane taskPaneControl1 = new WordConnectorPane();

                    IConnectorMainView connectorExplorer = ((System.Windows.Forms.Integration.ElementHost)taskPaneControl1.Controls[0]).Child as IConnectorMainView;
                    ApplicationContext.SetApplicationManager(new WordConnectorManager(Application, connectorExplorer));

                    Microsoft.Office.Tools.CustomTaskPane taskPaneValue = this.CustomTaskPanes.Add(taskPaneControl1, "Sobiens Office Connector", window);
                    taskPaneValue.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged);
                }
            }
        }
コード例 #44
0
        protected override void ExecuteAction(string ribbonId)
        {
            this.RegisterTaskPane(typeof(CustomShapePane), ShapesLabText.TaskPanelTitle);
            CustomTaskPane shapesLabPane = this.GetTaskPane(typeof(CustomShapePane));

            if (shapesLabPane == null)
            {
                return;
            }

            // toggle pane visibility
            shapesLabPane.Visible = !shapesLabPane.Visible;

            CustomShapePane customShapePane = shapesLabPane.Control as CustomShapePane;

            customShapePane.InitCustomShapePaneStorage();
        }
コード例 #45
0
        private void InspectorWrapper_Close()
        {
            taskPane.Control.SizeChanged -= Control_SizeChanged;
            Globals.ThisAddIn.CustomTaskPanes.Remove(taskPane);
            taskPane = null;

            instantLookup.Paused = true;
            instantLookup.OnLemmaFound -= InstantLookup_OnLemmaFound;
            instantLookup = null;

            Globals.ThisAddIn.InspectorWrappers.Remove(inspector);
            ((MSOutlook.InspectorEvents_Event)inspector).Close -= InspectorWrapper_Close;
            ((MSOutlook.InspectorEvents_Event)inspector).Deactivate -= InspectorWrapper_Deactivate;
            ((MSOutlook.InspectorEvents_Event)inspector).Activate -= InspectorWrapper_Activate;
            inspector = null;

            Properties.Settings.Default.Save(); //need to do this here, as I can't do it in the shutdown of the addon...
        }
コード例 #46
0
        public void Add(CustomTaskPane customTaskPane)
        {
            if (disposed) return;
            //Sync new task pane's properties up
            customTaskPane.Visible = original.Visible;
            customTaskPane.DockPosition = original.DockPosition;

            if (original.DockPosition != Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionTop &&
                original.DockPosition != Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionBottom)
            {
                customTaskPane.Width = original.Width;
            }
            if (original.DockPosition != Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionLeft &&
                original.DockPosition != Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight)
            {
                customTaskPane.Height = original.Height;
            }

            customTaskPanes.Add(customTaskPane);
            customTaskPane.DockPositionChanged += CustomTaskPaneDockPositionChanged;
            customTaskPane.VisibleChanged += CustomTaskPaneVisibleChanged;
        }
コード例 #47
0
 private void ThisAddIn_Startup(object sender, System.EventArgs e)
 {
     _ctp = Globals.ThisAddIn.CustomTaskPanes.Add(new Photo_Viewer_User_Control(), "Photo Viewer");
 }
コード例 #48
0
 /// <summary>
 /// Start handling the visibility events for a particular taskpane.
 /// </summary>
 /// <param name="ctp">A CustomTaskPane specifying the taskpane whose events we want to handle.</param>
 internal void ConnectTaskPaneEvents(CustomTaskPane ctp)
 {
     m_appEvents.ConnectTaskPaneEvents(ctp);
 }
コード例 #49
0
        /// <summary>
        /// 显示读取SAP表数据的控件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tgbtnShowReadTable_Click(object sender, RibbonControlEventArgs e)
        {
            if (_ReaTablePane == null)
            {
                _ReadTableControl = new ReadTableControl();
                _ReaTablePane = Globals.ThisAddIn.CustomTaskPanes.Add(_ReadTableControl, "读取SAP表内容");
                _ReaTablePane.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged);
                _ReaTablePane.Visible = true;
                _ReaTablePane.Width = 300;
            }
            else
            {
                _ReaTablePane.Visible = ((RibbonToggleButton)sender).Checked;

            }
        }
コード例 #50
0
        void DisposeTaskPane(CustomTaskPane c)
        {
            c.VisibleChanged -= CustomTaskPaneVisibleChanged;
            c.DockPositionChanged -= CustomTaskPaneDockPositionChanged;
            try
            {
                c.Dispose();
            }
            catch (ObjectDisposedException)
            {
            }

            customTaskPanes.Remove(c);
        }
コード例 #51
0
        /// <summary>
        /// 显示SAP Query控件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tgbtnQuery_Click(object sender, RibbonControlEventArgs e)
        {
            if (_SapQueryPane == null)
            {
                _SAPQueryControl = new SAPQueryControl();
                _SapQueryPane = Globals.ThisAddIn.CustomTaskPanes.Add(_SAPQueryControl, "SAP Query");
                _SapQueryPane.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionBottom;
                _SapQueryPane.VisibleChanged += new System.EventHandler(_SapQueryPane_VisibleChanged);
                _SapQueryPane.Visible = true;
            }
            else
            {

                _SapQueryPane.Visible = ((RibbonToggleButton)sender).Checked;
            }
        }
コード例 #52
0
ファイル: ComInterop.cs プロジェクト: red2901/ExcelDna
 public void DockPositionStateChange(CustomTaskPane pane1)
 {
     if (this.m_DockPositionStateChangeDelegate != null)
     {
         this.m_DockPositionStateChangeDelegate(pane1);
     }
 }
コード例 #53
0
ファイル: ThisAddIn.cs プロジェクト: nk9k/ExcelVerticalTab
 public PaneAndControl(CustomTaskPane pane, VerticalTabHost control)
 {
     Pane = pane;
     Control = control;
 }
コード例 #54
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            //添加浏览器控件
            webbrowserPane = new WebbrowserPane();
            taskpane = this.CustomTaskPanes.Add(webbrowserPane, "网页浏览器");
            taskpane.Width = 400;
            taskpane.Visible = false;

            //添加菜单按钮
            RemoveAddedMenuItems();
            AddRightClickMenuItems();
            //添加鼠标右键的事件
            this.Application.WindowBeforeRightClick += new Word.ApplicationEvents4_WindowBeforeRightClickEventHandler(Application_WindowBeforeRightClick);
        }
コード例 #55
0
        /// <summary>
        /// Adds a new item to workbookTaskPaneMap dictionary
        /// </summary>
        /// <param name="WorkbookName"></param>
        /// <param name="customTaskPane"></param>
        void AddToWorkbookTaskPaneMap(string WorkbookName, CustomTaskPane customTaskPane)
        {
            //TODO: Throw exception
            //if (workbookTaskPaneMap.ContainsKey(WorkbookName))

            workbookTaskPaneMap.Add(WorkbookName, customTaskPane);
        }
コード例 #56
0
 /// <summary>
 /// Connect the VisibleChanged event for an instance of our task pane.
 /// </summary>
 /// <param name="ctp">A CustomTaskPane specifying the new instance of the task pane.</param>
 public void ConnectTaskPaneEvents(CustomTaskPane ctp)
 {
     ctp.VisibleChanged += new System.EventHandler(ctp_VisibleChange);
 }
コード例 #57
0
        public void InitData(Excel.Workbook workbook, Excel.Worksheet worksheet, CustomTaskPane TaskPane, SheetConfig ShtCfg = null)
        {
            this.Wb = workbook;
            this.ws = worksheet;
            this.myTaskPane = TaskPane;

            ((DocEvents_Event)ws).Activate += ws_Activate;
            this.ws.Deactivate += ws_Deactivate;
            this.ws.Change += ws_Change;

            if (ShtCfg != null)
            {
                foreach (var col in ShtCfg.ColumnConfigData)
                {
                    if (col != null)
                    {
                        dataGridView1.Rows.Add(col.FieldName, col.FieldType, col.LimitMin, col.LimitMax, col.Export, col.Primarykey);
                    }
                }
            }
            else
            {
                ShtCfg = new SheetConfig();
                ShtCfg.Name = this.ws.Name;
            }
            this.SheetCfg = ShtCfg;

            this.ws_Change(this.ws.Cells[1, 1]); // 此时可能存在不合法数据(例如列名重复或列与配置不符),所以要按单元格内容变化的逻辑处理一次
        }
コード例 #58
0
ファイル: ThisAddIn.cs プロジェクト: jhagstrom/outcliso
 private void ThisAddIn_Startup(object sender, System.EventArgs e)
 {
     favoritesControl = new FavoritesControl();
     favoritesPane = CustomTaskPanes.Add(favoritesControl, "Favorites");
     favoritesPane.VisibleChanged += favoritesPane_VisibleChanged;
 }
コード例 #59
0
        void DisposeTaskPane(CustomTaskPane c)
        {
            c.VisibleChanged -= CustomTaskPaneVisibleChanged;
            c.DockPositionChanged -= CustomTaskPaneDockPositionChanged;
            try
            {
                var control = c.Control;
                foreach (var control1 in control.Controls.OfType<ElementHost>().ToArray())
                {
                    control1.Child = null;
                    control1.Dispose();
                    control1.Parent = null;
                    control.Controls.Remove(control1);
                }
            }
            catch (ObjectDisposedException)
            {
            }

            customTaskPanes.Remove(c);
        }
コード例 #60
0
ファイル: ComInterop.cs プロジェクト: red2901/ExcelDna
 public void VisibleStateChange(CustomTaskPane pane1)
 {
     if (this.m_VisibleStateChangeDelegate != null)
     {
         this.m_VisibleStateChangeDelegate(pane1);
     }
 }