示例#1
0
        internal ExecuteQuery InitializePane()
        {
            try
            {
                var gotPane = GetPane();
                if (gotPane != null)
                {
                    _customTaskPane = gotPane;

                    return(_customTaskPane.Control as ExecuteQuery);
                }

                var executeQueryControl = new ExecuteQuery();
                executeQueryControl.ExecuteCypher    += ExecuteCypher;
                executeQueryControl.ConnectDatabase  += ConnectDatabase;
                executeQueryControl.CreateNodes      += CreateNodes;
                executeQueryControl.ExecuteSelection += ExecuteSelection;

                _customTaskPane = CustomTaskPanes.Add(executeQueryControl, "Execute Query");

                _customTaskPane.Visible = true;
                return(executeQueryControl);
            }
            catch
            {
                return(null);
            }
        }
示例#2
0
        private void AddTaskPaneToWindow(Window window)
        {
            // Проверка панели задач в окне
            CustomTaskPane docPane      = null;
            CustomTaskPane paneToRemove = null;

            foreach (var displayPane in _timerDisplayPanes)
            {
                try
                {
                    if (displayPane.Window == window)
                    {
                        docPane = displayPane;
                        break;
                    }
                }
                catch (ArgumentNullException)
                {
                    paneToRemove = displayPane;
                }
            }

            // Удалим сомнительную панель задач
            _timerDisplayPanes.Remove(paneToRemove);

            // Добавить панель задач к документу
            if (docPane == null)
            {
                var pane = CustomTaskPanes.Add(new TimerDisplayPane(_documentEditTimes), "Document Edit Timer", window);
                _timerDisplayPanes.Add(pane);
                pane.VisibleChanged += OnPaneVisibleChanged;
            }
        }
示例#3
0
        public void CreateSheetNaviPane(bool ShowPane, Workbook workbook = null)
        {
            if (workbook == null)
            {
                if (Application.ActiveWorkbook != null)
                {
                    workbook = Application.ActiveWorkbook;
                }
                else
                {
                    return;
                }
            }

            if (!SheetNaviPaneDict.ContainsKey(workbook.Name))
            {
                SheetNavi obj = new SheetNavi(workbook);
                SheetNaviObjDict[workbook.Name] = obj;
                SheetNaviObjDict[workbook.Name].BtnEnDisableChk();

                SheetNaviPaneDict[workbook.Name] = CustomTaskPanes.Add(obj, "Sheet Navigation");
                SheetNaviPaneDict[workbook.Name].DockPosition = Properties.Settings.Default.SheetNavi_DockPosition;
                SheetNaviPaneDict[workbook.Name].Width        = 250;
            }

            if (ShowPane)
            {
                SheetNaviObjDict[workbook.Name].RefreshSheetList();
                SheetNaviPaneDict[workbook.Name].Visible = true;
            }
            else
            {
                ;    // false라고 해서 굳이 pane을 끄지는 않는다.
            }
        }
示例#4
0
        public void ShowPane()
        {
            RemovePane();
            UserControl userCtrl;
            string      title;

            switch (CurrentMode)
            {
            case Mode.AnalysisPerSheet:
                userCtrl = new UCtrlPerSheetAnalysis();
                title    = UCtrlPerSheetAnalysis.TaskPaneTitle;
                break;

            case Mode.AnalysisPerRow:
                userCtrl = new UCtrlPerRowAnalysis();
                title    = UCtrlPerRowAnalysis.TaskPaneTitle;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            var customPane = CustomTaskPanes.Add(userCtrl, title);

            customPane.Width   = userCtrl.Width + 300;
            customPane.Visible = true;
        }
        public void ShowPane()
        {
            RemovePane();
            UserControl userCtrl = null;
            string      title    = string.Empty;

            switch (CurrentMode)
            {
            case Mode.ANALYSIS_PERSHEET:
                userCtrl = new UCtrlPerSheetAnalysis();
                title    = UCtrlPerSheetAnalysis.TaskPaneTitle;
                break;

            case Mode.ANALYSIS_PERROW:
                userCtrl = new UCtrlPerRowAnalysis();
                title    = UCtrlPerRowAnalysis.TaskPaneTitle;
                break;

            default: break;
            }
            var customPane = CustomTaskPanes.Add(userCtrl, title);

            customPane.Width   = userCtrl.Width + 300;
            customPane.Visible = true;
        }
示例#6
0
        internal ExecuteQuery InitializePane()
        {
            try
            {
                var gotPane = GetPane();
                if (gotPane != null)
                {
                    _customTaskPane = gotPane;

                    return(_customTaskPane.Control as ExecuteQuery);
                }

                var executeQueryControl = new ExecuteQuery();
                executeQueryControl.ExecuteCypher             += ExecuteCypher;
                executeQueryControl.ConnectDatabase           += ConnectDatabase;
                executeQueryControl.CreateNodes               += CreateNodes;
                executeQueryControl.ExecuteSelection          += ExecuteSelection;
                executeQueryControl.CreateRelationships       += CreateRelationships;
                executeQueryControl.LoadButtonEventHandler    += LoadAllNodes;
                executeQueryControl.SyncAllButtonEventHandler += SyncAllNodes;
                executeQueryControl.UpdateButtonEventHandler  += UpdateAllNodes;


                _customTaskPane = CustomTaskPanes.Add(executeQueryControl, "Execute Query");

                _customTaskPane.Visible = true;
                return(executeQueryControl);
            }
            catch
            {
                return(null);
            }
        }
示例#7
0
        /// <summary>
        /// Removes orphaned task panes. When gets a task pane orphaned? - SER
        /// </summary>
        private void RemoveOrphanedTaskPanes()
        {
            var ctpc = new Collection <CustomTaskPane>();

            foreach (var ctp in CustomTaskPanes)
            {
                try
                {
                    if (ctp.Window == null)
                    {
                        ctpc.Add(ctp);
                    }
                }
                catch (COMException)
                {
                    // "Task Pane no longer valid" ...
                    ctpc.Add(ctp);
                }
            }

            foreach (var ctp in ctpc)
            {
                CustomTaskPanes.Remove(ctp);
            }
        }
示例#8
0
        private void Application_WorkbookActivate(Workbook Wb)
        {
            // This method is called whenever a workbook comes to the front
            // Does not necessarily need to be a workbook that is persisted on the disk
            var workbook = DataModel.Instance.WorkbookModels.Where(p => ReferenceEquals(p.Workbook, Wb))
                           .FirstOrDefault();

            if (workbook == null)
            {
                workbook = new WorkbookModel(Wb);
                DataModel.Instance.WorkbookModels.Add(workbook);

                DataModel.Instance.CurrentWorkbook = workbook;
                DataModel.Instance.CurrentWorkbook.LoadExtraInformation();

                /// create shared pane
                var SidebarContainer = new SidebarContainer();
                var Sidebar          = CustomTaskPanes.Add(SidebarContainer, "Sidebar");

                SidebarContainer.Sidebar.DataContext = workbook;
                Sidebar.Width = 320;
                TaskPanes.Add(new Tuple <WorkbookModel, string>(workbook, "Sidebar"), Sidebar);

                //add selection changed event handler for ribbon
                Wb.Application.SheetSelectionChange += DataModel.Instance.WorkbookSelectionChangedEventHandler;
            }

            DataModel.Instance.CurrentWorkbook = workbook;
        }
示例#9
0
 private CustomTaskPane FindTaskPane(_Document document, UserControl content)
 {
     if (document == null)
     {
         return(null);
     }
     return(CustomTaskPanes.FirstOrDefault(pane => (pane.Control == content) && (pane.Window == document.ActiveWindow)));
 }
示例#10
0
 private void RemoveAllTaskPanes()
 {
     foreach (CustomTaskPane pane in taskPaneMap.Values)
     {
         CustomTaskPanes.Remove(pane);
     }
     taskPaneMap.Clear();
 }
示例#11
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            //TaskPanetest taskPanetest = new TaskPanetest();测试

            //JudgeTaskPane judgeTaskPane = new JudgeTaskPane();
            _JudgeTaskPane         = CustomTaskPanes.Add(judgeTaskPane, "判断题");
            _JudgeTaskPane.Width   = 250;
            _JudgeTaskPane.Visible = false;
            Globals.ThisAddIn.Application.SlideSelectionChanged += new EApplication_SlideSelectionChangedEventHandler(isJudgeQuestionPPT);
            Globals.ThisAddIn.Application.SlideShowNextSlide    += JudgeQuestion_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowBegin        += JudgeQuestion_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowEnd          += JudgeQuestion_SlideShowEnd;

            //单选题必要
            _SingleChoiceTaskPane         = CustomTaskPanes.Add(singleChoiceTaskPane, "单选题");
            _SingleChoiceTaskPane.Width   = 250;
            _SingleChoiceTaskPane.Visible = false;
            Globals.ThisAddIn.Application.SlideSelectionChanged += new EApplication_SlideSelectionChangedEventHandler(isSingleChoicePPT);
            Globals.ThisAddIn.Application.SlideShowNextSlide    += Choice_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowBegin        += Choice_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowEnd          += Choice_SlideShowEnd;

            //多选题必要
            _MultipleChoiceTaskPane         = CustomTaskPanes.Add(multipleChoiceTaskPane, "多选题");
            _MultipleChoiceTaskPane.Width   = 250;
            _MultipleChoiceTaskPane.Visible = false;
            Globals.ThisAddIn.Application.SlideSelectionChanged += new EApplication_SlideSelectionChangedEventHandler(isMultipleChoicePPT);

            FillTaskPane FilltaskPane = new FillTaskPane();

            _FillTaskPane         = this.CustomTaskPanes.Add(FilltaskPane, "填空题");
            _FillTaskPane.Width   = 200;
            _FillTaskPane.Visible = false;
            Globals.ThisAddIn.Application.SlideSelectionChanged += new EApplication_SlideSelectionChangedEventHandler(IsFillQesttionPPT);
            Globals.ThisAddIn.Application.SlideShowNextSlide    += Fill_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowBegin        += Fill_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowEnd          += Fill_SlideShowEnd;

            SimpleQuestionTaskPane SimpleQuestiontaskPane = new SimpleQuestionTaskPane();

            _SimpleQuestionTaskPane         = this.CustomTaskPanes.Add(SimpleQuestiontaskPane, "简答题");
            _SimpleQuestionTaskPane.Width   = 200;
            _SimpleQuestionTaskPane.Visible = false;
            Globals.ThisAddIn.Application.SlideSelectionChanged += new EApplication_SlideSelectionChangedEventHandler(IsSimpleQesttionPPT);
            Globals.ThisAddIn.Application.SlideShowNextSlide    += Simple_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowBegin        += Simple_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowEnd          += Simple_SlideShowEnd;

            _VoteTaskPane         = CustomTaskPanes.Add(voteTaskPane, "投票");
            _VoteTaskPane.Width   = 250;
            _VoteTaskPane.Visible = false;
            Globals.ThisAddIn.Application.SlideSelectionChanged += new EApplication_SlideSelectionChangedEventHandler(isVotePPT);
            Globals.ThisAddIn.Application.SlideShowNextSlide    += Vote_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowBegin        += Vote_SlideShowNextSlide;
            Globals.ThisAddIn.Application.SlideShowEnd          += Vote_SlideShowEnd;
        }
        private void ThisAddIn_NewWorkbook(Excel.Workbook wb)
        {
            myUserControl1 = new MyUserControl();
            CustomTaskPane tempCTP;

            tempCTP = CustomTaskPanes.Add(myUserControl1, wb.FullName);
            tempCTP.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionLeft;
            tempCTP.Visible      = false;
            CTPDictionary.Add(wb.FullName, tempCTP);
        }
示例#13
0
        private void AddTaskPane(MSWord.Document doc)
        {
            CustomTaskPane taskPane = CustomTaskPanes.Add(new LookupPane(), "German Grammar", doc.ActiveWindow);

            taskPane.Control.Tag          = taskPane;
            taskPane.Width                = paneWidth;
            taskPane.Visible              = true;
            taskPane.Control.SizeChanged += TaskPane_SizeChanged;
            taskPaneMap.Add(doc, taskPane);
        }
示例#14
0
 private void ArticleBrowserAddIn_Startup(object sender, EventArgs e)
 {
     // Load the WPF ControlHost to be the design surface for WPF UI
     _host = new ControlHost();
     _host.Form1_Load(this, EventArgs.Empty);
     // Add the name of the plugin
     _myTaskPane         = CustomTaskPanes.Add(_host, "ArticleBrowser");
     _myTaskPane.Visible = true;
     // Bring the control to front, so drag n drop element work
     _myTaskPane.Control.BringToFront();
 }
示例#15
0
 public void RemovePane()
 {
     for (var i = 0; i < CustomTaskPanes.Count; ++i)
     {
         var ctp = CustomTaskPanes[i];
         if (ctp.Title == UCtrlPerRowAnalysis.TaskPaneTitle || ctp.Title == UCtrlPerSheetAnalysis.TaskPaneTitle)
         {
             CustomTaskPanes.RemoveAt(i);
         }
     }
 }
示例#16
0
 void ThisAddIn_DocumentClose()
 {
     connectedTaskPane = false;
     CustomTaskPanes.Remove(ctpAnnouncements);
     if (xlApp != null)
     {
         xlApp.Quit();
         xlApp = null;
     }
     wdDoc = null;
 }
示例#17
0
        private void RemoveTaskPaneFromWindow(Window window)
        {
            // Проверить наличие панели задач в окне
            var dockPane = _timerDisplayPanes.FirstOrDefault(taskPane => taskPane.Window == window);

            // Удалить панель задач документа
            if (dockPane != null)
            {
                CustomTaskPanes.Remove(dockPane);
                _timerDisplayPanes.Remove(dockPane);
            }
        }
示例#18
0
        private void ThisAddIn_Startup(object sender, EventArgs e)
        {
            _contentHost.WpfElementHost.Child = new SafeguardForm
            {
                // TODO: Create interface instances
                DataContext = new AddinViewModel(new SafeguardTestImpl(), new ExcelTestImpl())
            };

            var taskPane = CustomTaskPanes.Add(_contentHost, "Safeguard");

            taskPane.Visible = true;
        }
示例#19
0
 private void CleanUpPaneAndControl(PaneAndControl target)
 {
     target.Control.CurrentHandler?.Dispose();
     try
     {
         target.Pane.VisibleChanged -= Pane_VisibleChanged;
         CustomTaskPanes.Remove(target.Pane);
     }
     catch (ObjectDisposedException)
     {
         // 無視
     }
 }
示例#20
0
        public void CreateLogPane()
        {
            try
            {
                var removeItems = new List <CustomTaskPane>();
                // remove non-visible panes
                foreach (var pane in CustomTaskPanes)
                {
                    try
                    {
                        if (!pane.Visible)
                        {
                            removeItems.Add(pane);
                        }
                    }
                    catch (Exception)
                    {
                        removeItems.Add(pane);
                    }
                }
                foreach (var customTaskPane in removeItems)
                {
                    CustomTaskPanes.Remove(customTaskPane);
                }
                var currWindow = Application.Windows[1];

                var visible = false;
                foreach (var pane in CustomTaskPanes)
                {
                    if (((Window)pane.Window).Hwnd == currWindow.Hwnd)
                    {
                        visible = true;
                        LogPane = pane;
                        Pane    = LogPane.Control as LogPane;
                        break;
                    }
                }

                if (!visible)
                {
                    Pane = new LogPane();

                    LogPane = CustomTaskPanes.Add(Pane, "TheySay Log", currWindow);
                }
                LogPane.Visible = true;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
示例#21
0
        private void myCustomTaskPaneSkyNet_VisibleChanged(object sender, EventArgs e)
        {
            Globals.Ribbons.ManageTaskPaneRibbon.toggleButtonLancer.Checked = myCustomTaskPaneSkyNet.Visible;

            // Retirer l'utilitaire de la mémoire si non visible.
            if (!myCustomTaskPaneSkyNet.Visible)
            {
                CustomTaskPanes.Remove(myCustomTaskPaneSkyNet);
                myCustomTaskPaneSkyNet = null;
            }

            //ManageTaskPaneRibbon.rUI.RibbonUI.ActivateTab("TabAddIns");
            Globals.Ribbons.ManageTaskPaneRibbon.RibbonUI.ActivateTab("tab2");
        }
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            var container = new UnityContainer();

            container.RegisterSingleton <IHashTagsViewModel, HashTagsViewModel>();
            container.RegisterInstance <IAddIn>(this);
            vm = container.Resolve <IHashTagsViewModel>();
            this.Application.DocumentBeforeSave +=
                Application_DocumentBeforeSave;
            CustomTaskPane pane = CustomTaskPanes.FirstOrDefault(p => p.Title == paneName) ??
                                  this.CustomTaskPanes.Add(container.Resolve <HashTagsForm>(), paneName);

            //pane.Visible = true;
            Panes.HashTags = pane;
        }
示例#23
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            foreach (Outlook.Explorer explorer in Application.Explorers)
            {
                explorer.SelectionChange += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_SelectionChangeEventHandler(explorer_SelectionChange);
            }

            Application.Explorers.NewExplorer   += new Microsoft.Office.Interop.Outlook.ExplorersEvents_NewExplorerEventHandler(Explorers_NewExplorer);
            Application.Inspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);

            Application.ItemLoad += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemLoadEventHandler(Application_ItemLoad);

            myUserControl1           = new MyUserControl();
            myCustomTaskPane         = CustomTaskPanes.Add(myUserControl1, "My Task Pane");
            myCustomTaskPane.Visible = true;
        }
示例#24
0
        private void Application_WorkbookActivate(Microsoft.Office.Interop.Excel.Workbook Wb)
        {
            // This method is called whenever a workbook comes to the front
            // Does not necessarily need to be a workbook that is persisted on the disk
            var workbook = DataModel.Instance.WorkbookModels.Where(p => ReferenceEquals(p.Workbook, Wb)).FirstOrDefault();
            if (workbook == null)
            {
                workbook = new WorkbookModel(Wb);
                DataModel.Instance.WorkbookModels.Add(workbook);

                DataModel.Instance.CurrentWorkbook = workbook;
                DataModel.Instance.CurrentWorkbook.LoadExtraInformation();

                /// create shared pane
                var sharedPaneContainer = new SharedPaneContainer();
                var sharedPane = CustomTaskPanes.Add(sharedPaneContainer, "Inspection");
                sharedPaneContainer.VisibleChanged += SharedPaneContainer_VisibleChanged;

                sharedPaneContainer.SharedPane.DataContext = workbook;
                sharedPane.Width = 340;
                TaskPanes.Add(new Tuple<WorkbookModel, string>(workbook, "shared Pane"), sharedPane);

                // create findings pane
                var violationViewContainer = new ViolationsViewContainer();
                var taskPane = CustomTaskPanes.Add(violationViewContainer, "Violations");
                violationViewContainer.VisibleChanged += FindingsPaneContainer_VisibleChanged;

                violationViewContainer.ViolationsView.DataContext = workbook;
                TaskPanes.Add(new Tuple<WorkbookModel, string>(workbook, "Violations"), taskPane);

                //create scenario detail pane
                var scenarioDetailPainContainer = new ScenarioDetailPaneContainer();
                var scenarioDetailPane = CustomTaskPanes.Add(scenarioDetailPainContainer, "Scenario");
                scenarioDetailPane.Width = 260;
                scenarioDetailPainContainer.VisibleChanged += ScenarioDetailPaneContainer_VisibleChanged;

                TaskPanes.Add(new Tuple<WorkbookModel, string>(workbook, "Scenario Details"), scenarioDetailPane);

                //add selection changed event handler for ribbon
                Wb.Application.SheetSelectionChange += DataModel.Instance.WorkbookSelectionChangedEventHandler;
                workbook.CellDefinitionChange += DataModel.Instance.CellDefinitionChangedEventHandler;

            }

            DataModel.Instance.CurrentWorkbook = workbook;
        }
示例#25
0
        /// <summary>
        /// Shows the task pane with the specified content.
        /// Either turns an existing pane visible or creates a new task pane
        /// </summary>
        public void ShowTaskPane(_Document document, UserControl content, string title)
        {
            if (document == null || content == null)
            {
                return;
            }

            var pane = FindTaskPane(document, content);

            if (pane == null)
            {
                pane = CustomTaskPanes.Add(content, title, document.ActiveWindow);
                pane.VisibleChanged += HandleCustomTaskPaneVisibleChanged;
            }

            pane.Visible = true;
        }
示例#26
0
        private void RemoveOrphanedTaskPanes()
        {
            List <MSWord.Document> removedDocuments = new List <MSWord.Document>();

            foreach (KeyValuePair <MSWord.Document, CustomTaskPane> entry in taskPaneMap)
            {
                if (entry.Value.Window == null)
                {
                    CustomTaskPanes.Remove(entry.Value);
                    removedDocuments.Add(entry.Key);
                }
            }
            foreach (MSWord.Document document in removedDocuments)
            {
                taskPaneMap.Remove(document);
            }
        }
示例#27
0
        private PaneAndControl CreatePane(Excel.Workbook wb)
        {
            var control = new VerticalTabHost();

            control.Initialize();

            // ActiveWindowがずれてしまうことがあるっぽいような
            var w    = wb.Windows.OfType <Excel.Window>().FirstOrDefault() ?? Application.ActiveWindow; // ActiveWindowは保険
            var pane = CustomTaskPanes.Add(control, "VTab", w);

            pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionLeft;
            pane.Visible      = true;

            pane.VisibleChanged += Pane_VisibleChanged;

            return(new PaneAndControl(pane, control));
        }
示例#28
0
 /// <summary>
 /// Método que crea un panel de validación de cruces por cada instancia de Excel
 /// </summary>
 /// <param name="wb"></param>
 private void Application_WorkbookActivate(Microsoft.Office.Interop.Excel.Workbook wb)
 {
     try
     {
         System.IO.FileInfo _ExcelFI = new System.IO.FileInfo(Globals.ThisAddIn.Application.ActiveWorkbook.Name);
         vdcUserControl   = new VerificacionDeCruce();
         myCustomTaskPane = CustomTaskPanes.Add(vdcUserControl, "Verificación " + _ExcelFI.Name);
         myCustomTaskPane.DockPosition         = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
         myCustomTaskPane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
         myCustomTaskPane.Width   = 515;
         myCustomTaskPane.Visible = false;
     }
     catch (Exception ex)
     {
         throw new Exception($"Error al instanciar el Task Panel de Validacion. [ThisAddIn].[Application_WorkbookActivate].[26]: {ex.Message}");
     }
 }
示例#29
0
        /// <summary>
        /// add right panel into document
        /// </summary>
        public void AddProntoTaskPane()
        {
            try
            {
                TemplateInfo templateInfo = this.TemplateInfo;
                if (templateInfo.RightPanel != null)
                {
                    CustomTaskPanes.Add(templateInfo.RightPanel.Control, Properties.Resources.ipm_RibbonTitle);
                }
                else
                {
                    ProntoDocMarkup proMarkupCtrl = new ProntoDocMarkup();

                    // backup width before add
                    int parentWidth = proMarkupCtrl.cboDomain.Parent.Width;
                    int width       = proMarkupCtrl.cboDomain.Width;

                    // add to right panel of document
                    templateInfo.RightPanel = CustomTaskPanes.Add(proMarkupCtrl, Properties.Resources.ipm_RibbonTitle);

                    // after add, the width of domain control is reset to 0 then we need restore its.
                    proMarkupCtrl.cboDomain.Parent.Width = parentWidth;
                    proMarkupCtrl.cboDomain.Width        = width;

                    templateInfo.RightPanel.Width           = 252;
                    templateInfo.RightPanel.Visible         = true;
                    templateInfo.RightPanel.VisibleChanged += new EventHandler(ProntoTaskPane_VisibleChanged);

                    if (ActiveDocument != null)
                    {
                        AddOrderContextMenu();
                    }
                }

                SetHeightForProntoDocMarkup();
            }
            catch (BaseException srvExp)
            {
                ManagerException mgrExp = new ManagerException(ErrorCode.ipe_LoadResourceError);
                mgrExp.Errors.Add(srvExp);

                LogUtils.LogManagerError(mgrExp);
            }
        }
示例#30
-1
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            Trello     = new Trello("1ed8d91b5af35305a60e169a321ac248");
            MessageBus = new MessageBus();

            var exportCardsControl = new ExportCardsControl();
            var importCardsControl = new ImportCardsControl();
            var authorizeForm      = new AuthorizationDialog();

            ExportCardsTaskPane       = CustomTaskPanes.Add(exportCardsControl, "Export cards to Trello");
            ExportCardsTaskPane.Width = 300;
            ExportCardsTaskPane.DockPositionRestrict = MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;

            ImportCardsTaskPane       = CustomTaskPanes.Add(importCardsControl, "Import cards from Trello");
            ImportCardsTaskPane.Width = 300;
            ImportCardsTaskPane.DockPositionRestrict = MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;

            TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();

            ExportCardsPresenter = new ExportCardsPresenter(exportCardsControl, Trello, new GridToNewCardTransformer(), TaskScheduler, MessageBus);
            ImportCardsPresenter = new ImportCardsPresenter(importCardsControl, MessageBus, Trello, TaskScheduler);
            AuthorizePresenter   = new AuthorizePresenter(authorizeForm, Trello, MessageBus);

            Globals.Ribbons.TrelloRibbon.SetMessageBus(MessageBus);

            TryToAuthorizeTrello();
        }