Exemplo n.º 1
0
 void WrappedInspectorWindow_InvalidateControl(object sender, OutlookInspector.InvalidateEventArgs e)
 {
     if (m_Ribbon != null)
     {
         m_Ribbon.InvalidateControl(e.ControlID);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Invalidate the controls added by the redaction tool.
 /// </summary>
 private void InvalidateRedactionControls()
 {
     Ribbon.InvalidateControl("splitButtonMark");
     Ribbon.InvalidateControl("splitButtonUnmark");
     Ribbon.InvalidateControl("buttonPrevious");
     Ribbon.InvalidateControl("buttonNext");
 }
Exemplo n.º 3
0
        public async Task CreateWorkItem(Office.IRibbonControl control)
        {
            Globals.ThisAddIn.ChangeTaskPaneVisibility(false);
            // Determine subject of selected item
            if (_explorer?.Selection?.Count > 0)
            {
                var mailItem = _explorer.Selection[1] as MailItem;
                if (mailItem == null)
                {
                    return;
                }
                _createWorkItemButtonEnabled = false;
                ribbon.InvalidateControl("CreateWorkItem");
                try
                {
                    if ((Models.WorkItem.CategoriesBySource?.Count > 0 && Models.WorkItem.CategoriesByComplexity?.Count > 0) || await TfsUtility.ValidateVssSettings())
                    {
                        var workItems = await TfsUtility.FindWorkItemsByTitle(HtmlUtility.RemoveSubjectAbbreviationsFromSubject(mailItem.Subject));

                        synchronizationContext.Send(new SendOrPostCallback(o => Globals.ThisAddIn.FillTaskPane(workItems, mailItem)), null);
                    }
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(TfsUtility.ProcessException(ex), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {
                    synchronizationContext.Send(new SendOrPostCallback(o => EnableCreateNewWorkItemButton()), null);
                }
            }
        }
Exemplo n.º 4
0
        //ここにコールバック メソッドを作成します。コールバック メソッドの追加方法の詳細については、http://go.microsoft.com/fwlink/?LinkID=271226 にアクセスしてください。

        public void Ribbon_Load(Office.IRibbonUI ribbonUI)
        {
            ribbonUI.InvalidateControl("tabGCPDocumentManagement");
            ribbonUI.InvalidateControl("grpDocumentManagement");
            ribbonUI.InvalidateControl("btnSAB");

            this.ribbon = ribbonUI;
        }
Exemplo n.º 5
0
        public void onCommandActionToggle(Office.IRibbonControl control, bool isPressed)
        {
            onCommandAction(control);

            if (getControlPressed(control) != isPressed)
            {
                // Press status hasn't changed, but Outlook will think it has, force update
                _officeUI?.InvalidateControl(control.Id);
            }
        }
Exemplo n.º 6
0
 void invalidateFolderContextMenu()
 {
     try
     {
         if (_folderContextMenu != null)
         {
             _folderContextMenu.InvalidateControl("FolderMonitorItemEvents");
             _folderContextMenu.InvalidateControl("FolderUnmonitorItemEvents");
         }
     }
     catch { }
 }
Exemplo n.º 7
0
 internal void InvalidateButtons()
 {
     ribbon.InvalidateControl(SignButton.Id);
     ribbon.InvalidateControl(EncryptButton.Id);
     ribbon.InvalidateControl(VerifyButton.Id);
     ribbon.InvalidateControl(DecryptButton.Id);
 }
 public void OnEnableDisableButton(Office.IRibbonControl control)
 {
     Properties.Settings.Default.AddInEnabled = !Properties.Settings.Default.AddInEnabled;
     Properties.Settings.Default.Save();
     ribbon.InvalidateControl(control.Id);
     OnEnableDisableAddIn?.Invoke(null, null);
 }
Exemplo n.º 9
0
        public void OnClick_PinnedFiles(Office.IRibbonControl ctrl)
        {
            List <Model.PinnedFile> files = Config.PinnedFiles;

            if (files == null)
            {
                files = new List <Model.PinnedFile>();
            }

            // 检查是否已经存在
            foreach (var f in files)
            {
                if (f.FilePath == Common.ActiveBook?.FullName)
                {
                    return;
                }
            }

            // 添加到固定列表
            Model.PinnedFile tmpFile = new Model.PinnedFile();
            tmpFile.FilePath = Common.ActiveBook?.FullName;
            tmpFile.FileName = Common.ActiveBook?.Name;
            tmpFile.Mark     = System.Guid.NewGuid().ToString("N").ToUpper();
            files.Add(tmpFile);

            Config.PinnedFiles = files;
            Config.SaveConfig();
            ribbon.InvalidateControl("ZS_LIST_PinnedFiles");
            Msg.ShowSuccess("添加完成!");
        }
Exemplo n.º 10
0
 internal void InvalidateControl(string controlID)
 {
     if (ribbon != null)
     {
         ribbon.InvalidateControl(controlID);
     }
 }
Exemplo n.º 11
0
        internal void InvalidateButtons()
        {
            if (ribbon == null)
            {
                return;
            }

            ribbon.InvalidateControl(SignButton.Id);
            ribbon.InvalidateControl(EncryptButton.Id);
            ribbon.InvalidateControl(VerifyButton.Id);
            ribbon.InvalidateControl(DecryptButton.Id);
            ribbon.InvalidateControl(AttachPublicKeyButton.Id);
        }
 protected void OnSizeChanged()
 {
     if (this.ribbonUI != null)
     {
         this.Page.CrearBmp();
         ribbonUI.InvalidateControl(IMAGECONTROL_PRINTIMAGE);
     }
 }
Exemplo n.º 13
0
 public void Invalidate()
 {
     try {
         if (ribbon.IsNotNullOrMissing())
         {
             ribbon.Invalidate();
             ribbon.InvalidateControl("TabShare");
         }
     }
     catch { }
 }
Exemplo n.º 14
0
 public void EditBoxTextChange(IRibbonControl control, string text)
 {
     for (var i = 0; i < data.Count(); ++i)
     {
         if (data[i] == text)
         {
             selectedIndex = i;
             ribbon.InvalidateControl("dropDown1");
             break;
         }
     }
 }
Exemplo n.º 15
0
 public void RefreshRibbonControl(String controlId)
 {
     try
     {
         _ribbon.InvalidateControl(controlId);
     }
     catch (Exception e)
     {
         Logger.LogException(e, "RefreshRibbonControl");
         throw;
     }
 }
Exemplo n.º 16
0
        private void Default_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
            case nameof(settings.Ribbon_ShowCoffeeButton):
            {
                coffeeButtons.ForEach(RefreshRibbonControl);
                break;
            }

            case nameof(settings.Ribbon_ShowDownsizerTab):
            {
                tabHideOrRevealButtons.ForEach(RefreshRibbonControl);
                break;
            }

            case nameof(settings.Stat_UsageCounter):
            {
                if (settings.Ribbon_ShowCoffeeButton)
                {
                    coffeeButtons.ForEach(RefreshRibbonControl);
                }
                else
                {
                    if (!settings.Coffee_AlreadyBought && settings.Stat_UsageCounter > 0)
                    {
                        settings.Coffee_HiddenSinceCounter++;
                        settings.Save();
                    }
                }
                break;
            }

            case nameof(settings.Ribbon_ShowUpdateButton):
            {
                ribbon.InvalidateControl("BtnUpdate");
                break;
            }
            }
        }
        public void OnSelectedIssueType(Office.IRibbonControl control, String selectedID, int selectedIndex)
        {
            switch (selectedIndex)
            {
            case 0:
                CurrentSelectedIssueType = new JiraIssueType()
                {
                    Name = "Case"
                };
                break;

            case 1:
                CurrentSelectedIssueType = new JiraIssueType()
                {
                    Name = "Bug"
                };
                break;

            case 2:
                CurrentSelectedIssueType = new JiraIssueType()
                {
                    Name = "Task"
                };
                break;

            case 3:
                CurrentSelectedIssueType = new JiraIssueType()
                {
                    Name = "OnlineBug"
                };
                break;
            }
            ribbon.InvalidateControl("drpExplorerSelectIssueType");
            ribbon.InvalidateControl("drpInspectorSelectIssueType");

            CheckRequiredFieldValue();
        }
Exemplo n.º 18
0
        /// <summary>
        /// Return the updated value from the comboxbox
        /// </summary>
        /// <param name="control">Represents the object passed into the callback procedure of a control in a ribbon or another user interface that can be customized by using Office Fluent ribbon extensibility. </param>
        /// <param name="text">Represents the text from the combobox value </param>
        public void OnChange(Office.IRibbonControl control, string text)
        {
            try
            {
                switch (control.Id)
                {
                case "cboServerName":
                    Properties.Settings.Default.Ping_ServerName = text;
                    break;

                case "cboPingName":
                    Properties.Settings.Default.Ping_Results = text;
                    break;

                case "cboRdgServer":
                    Properties.Settings.Default.Rdg_ServerName = text;
                    break;

                case "cboRdgDescription":
                    Properties.Settings.Default.Rdg_Description = text;
                    break;

                case "txtFileName":
                    Properties.Settings.Default.Rdg_FileName = text;
                    break;
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.DisplayMessage(ex);
            }
            finally
            {
                Properties.Settings.Default.Save();
                ribbon.InvalidateControl(control.Id);
            }
        }
Exemplo n.º 19
0
        private void UpdateRibbonFileName(string fileName)
        {
            string fileNameText = Strings.fileNameLabel;
            string fileLabel    = (fileNameText.Split(':'))[0];

            fileLabel += ": ";
            //fileName is currently the whole path
            //so trim down to the actual file name
            int    lastIndexFileName = fileName.LastIndexOf('\\');
            string displayFileName   = fileName.Substring(lastIndexFileName + 1);

            fileLabel += displayFileName;

            Strings.fileNameLabel = fileLabel;

            //render
            ribbon.InvalidateControl("FileNameLabel");

            //save file name
            //we need it when accessing file again to add unknown words
            this.fileName = fileName;
        }
Exemplo n.º 20
0
 /// <summary>
 /// Return the updated value from the comboxbox
 /// </summary>
 /// <param name="control">Represents the object passed into the callback procedure of a control in a ribbon or another user interface that can be customized by using Office Fluent ribbon extensibility. </param>
 /// <param name="text">Represents the text from the combobox value </param>
 public void OnChange(Office.IRibbonControl control, string text)
 {
     try
     {
         switch (control.Id)
         {
         case "cboTableAlias":
             //Properties.Settings.Default.Table_ColumnTableAlias = text;
             //Data.InsertRecord(Data.TableAliasTable, text);
             break;
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.DisplayMessage(ex);
     }
     finally
     {
         Properties.Settings.Default.Save();
         ribbon.InvalidateControl(control.Id);
     }
 }
Exemplo n.º 21
0
 // Toggles the boolean controlling the visibility of the Drawing Tools Format Tab
 public void ToggleVisibility(Office.IRibbonControl control, bool pressed)
 {
     DisableFormatTab = pressed;
     _ribbon.InvalidateControlMso("TabDrawingToolsFormat");
     _ribbon.InvalidateControl("VisibleFormatShapes");
 }
Exemplo n.º 22
0
 private static void WrappedInspectorWindow_InvalidateControl(object sender, OutlookInspector.InvalidateEventArgs e)
 {
     Ribbon?.InvalidateControl(e.ControlId);
 }
Exemplo n.º 23
0
 public void updateMonitorRibbon()
 {
     ribbon.InvalidateControl("toggleButton_ribbon");
     ribbon.InvalidateControl("rev_cbo");
     ribbon.InvalidateControl("date_cbo");
 }
Exemplo n.º 24
0
        public void OnIdChange(Office.IRibbonControl control, string text)
        {
            if (control.Id == "edbLinkWiID")
            {
                if (text == "")
                {
                    addIn.LinkWorkItemId = LinkWorkItemID = 0;
                    LinkWorkItemTextInfo = "";
                    ribbon.InvalidateControl("edbLinkWi");
                }
                else
                {
                    int id = 0;
                    if (int.TryParse(text, out id))
                    {
                        string title, type;
                        if (tfsManager.GetWorkItemTextInfo(id, out title, out type))
                        {
                            LinkWorkItemTextInfo = type + ": " + title;
                            addIn.LinkWorkItemId = LinkWorkItemID = id;

                            ribbon.InvalidateControl("edbLinkWi");
                        }
                    }
                    else
                    {
                        addIn.LinkWorkItemId = LinkWorkItemID = 0;
                        LinkWorkItemTextInfo = "";
                        ribbon.InvalidateControl("edbLinkWi");
                    }
                }
            }
        }
Exemplo n.º 25
0
 /// <summary>
 /// Changes the toggle state of the control with id ShowMySqlForExcelPane defined in the Ribbon.xml.
 /// </summary>
 /// <param name="pressed"></param>
 public void ChangeShowMySqlForExcelPaneToggleState(bool pressed)
 {
     ShowMySqlForExcelPaneTogglePressed = pressed;
     _ribbon.InvalidateControl("ShowMySqlForExcelPane");
 }
Exemplo n.º 26
0
 public void Refresh()
 {
     ribbon.InvalidateControl("taskPaneToggleButton");
 }
Exemplo n.º 27
0
 public void InvalidatePanesVisibility()
 {
     ribbon.InvalidateControl("chkVisibility");
 }
Exemplo n.º 28
0
 /// <summary>
 /// 辅助面板的可见性变更事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MainTaskPan_VisibleChanged(object sender, EventArgs e)
 {
     // 更新界面按钮的状态
     ribbon.InvalidateControl("ZS_BTN_ShowMainPan");
 }