private void ToggleInspector(RibbonToggleButton button, Inspector inspector)
 {
     if (inspector == null) return;
     var inspectorWrapper = Globals.ThisAddIn.InspectorWrappers[inspector];
     CustomTaskPane taskPane = inspectorWrapper.CustomTaskPane;
     if (taskPane != null)
     {
         taskPane.Visible = button.Checked;
     }
 }
 private void ToggleExplorer(RibbonToggleButton button, Explorer explorer)
 {
     if (explorer == null) return;
     var inspectorWrapper = Globals.ThisAddIn.ExplorerWrappers[explorer];
     CustomTaskPane taskPane = inspectorWrapper.CustomTaskPane;
     if (taskPane != null)
     {
         taskPane.Visible = button.Checked;
     }
 }
Example #3
0
 private void RefreshMdiWindowList()
 {
     RibbonItemCollection items = switchWindowsToggleGroup.Items;
     for (int i = 0; i < items.Count; i++)
         items[i].Dispose();
     items.Clear();
     Form[] forms = MdiChildren;
     Form activeChild = ActiveMdiChild;
     for (int i = 0; i < forms.Length; i++)
     {
         frmList f = forms[i] as frmList;
         if (f != null && !f.BeingDisposed)
         {
             RibbonToggleButton tb = new RibbonToggleButton();
             tb.Pressed = object.ReferenceEquals(f, activeChild);
             tb.Text = f.Text;
             tb.Tag = f;
             items.Add(tb);
         }
     }
     switchWindowsMenu.Enabled = items.Count > 0;
 }
Example #4
0
 private void UpdateFontToggleButtonState(RibbonToggleButton button, DependencyProperty formatProp, object targetValue)
 {
     object currentValue = richTextBox_Main.Selection.GetPropertyValue(formatProp);
     button.IsChecked = (currentValue == DependencyProperty.UnsetValue) ? false : currentValue != null && currentValue.Equals(targetValue);
 }