예제 #1
0
 public static void ToggleEnabled(this IRibbonControlEnabled control, bool enabled)
 {
     //ThisRibbonCollection ribbonCollection = Globals.Ribbons[control.Context];
     //IRibbonExtension ribbonExtension = ribbonCollection.GetRibbon(typeof (Ribbon));
     //var rb = Globals.ThisAddIn.ribbon as IRibbonUI;
     //control.IsEnabled = enabled;
     //Debug.WriteLine($"Toggle {control.IsEnabled}");
     //rb?.InvalidateControl(control.Id);
 }
예제 #2
0
        public async void OnActionCallback(Office.IRibbonControl control)
        {
            IRibbonControlObject controlObject = _controlFactory.GetControlObject(control);

            if (controlObject == null)
            {
                return;
            }

            IRibbonControlEnabled controlObjectEnabled = controlObject as IRibbonControlEnabled;

            //ribbon.ToggleEnabled(false);
            var rb1 = Globals.Ribbons[control.Context as Inspector];
            await controlObject.OnActionCallback();

            //controlObjectEnabled?.ToggleEnabled(true);
        }