コード例 #1
0
 void WrappedInspectorWindow_InvalidateControl(object sender, OutlookInspector.InvalidateEventArgs e)
 {
     if (m_Ribbon != null)
     {
         m_Ribbon.InvalidateControl(e.ControlID);
     }
 }
コード例 #2
0
ファイル: MyRibbon.cs プロジェクト: res0o43m/Redaction
 /// <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");
 }
コード例 #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);
                }
            }
        }
コード例 #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;
        }
コード例 #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);
            }
        }
コード例 #6
0
 void invalidateFolderContextMenu()
 {
     try
     {
         if (_folderContextMenu != null)
         {
             _folderContextMenu.InvalidateControl("FolderMonitorItemEvents");
             _folderContextMenu.InvalidateControl("FolderUnmonitorItemEvents");
         }
     }
     catch { }
 }
コード例 #7
0
 internal void InvalidateButtons()
 {
     ribbon.InvalidateControl(SignButton.Id);
     ribbon.InvalidateControl(EncryptButton.Id);
     ribbon.InvalidateControl(VerifyButton.Id);
     ribbon.InvalidateControl(DecryptButton.Id);
 }
コード例 #8
0
 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);
 }
コード例 #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("添加完成!");
        }
コード例 #10
0
 internal void InvalidateControl(string controlID)
 {
     if (ribbon != null)
     {
         ribbon.InvalidateControl(controlID);
     }
 }
コード例 #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);
        }
コード例 #12
0
 protected void OnSizeChanged()
 {
     if (this.ribbonUI != null)
     {
         this.Page.CrearBmp();
         ribbonUI.InvalidateControl(IMAGECONTROL_PRINTIMAGE);
     }
 }
コード例 #13
0
 public void Invalidate()
 {
     try {
         if (ribbon.IsNotNullOrMissing())
         {
             ribbon.Invalidate();
             ribbon.InvalidateControl("TabShare");
         }
     }
     catch { }
 }
コード例 #14
0
ファイル: Ribbon1.cs プロジェクト: schmidt9/FocusTest
 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;
         }
     }
 }
コード例 #15
0
ファイル: Ribbon1.cs プロジェクト: junkiattan/PowerPointLabs
 public void RefreshRibbonControl(String controlId)
 {
     try
     {
         _ribbon.InvalidateControl(controlId);
     }
     catch (Exception e)
     {
         Logger.LogException(e, "RefreshRibbonControl");
         throw;
     }
 }
コード例 #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;
            }
            }
        }
コード例 #17
0
        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();
        }
コード例 #18
0
ファイル: Ribbon.cs プロジェクト: liuhu666888/Server-Help
        /// <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);
            }
        }
コード例 #19
0
ファイル: Ribbon.cs プロジェクト: rmitsubayashi/StopLight
        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;
        }
コード例 #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);
     }
 }
コード例 #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");
 }
コード例 #22
0
 private static void WrappedInspectorWindow_InvalidateControl(object sender, OutlookInspector.InvalidateEventArgs e)
 {
     Ribbon?.InvalidateControl(e.ControlId);
 }
コード例 #23
0
ファイル: MyRibbon.cs プロジェクト: goffer14/WordAddin
 public void updateMonitorRibbon()
 {
     ribbon.InvalidateControl("toggleButton_ribbon");
     ribbon.InvalidateControl("rev_cbo");
     ribbon.InvalidateControl("date_cbo");
 }
コード例 #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");
                    }
                }
            }
        }
コード例 #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");
 }
コード例 #26
0
ファイル: Ribbon1.cs プロジェクト: samadm/ReportGenerator
 public void Refresh()
 {
     ribbon.InvalidateControl("taskPaneToggleButton");
 }
コード例 #27
0
 public void InvalidatePanesVisibility()
 {
     ribbon.InvalidateControl("chkVisibility");
 }
コード例 #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");
 }