Пример #1
0
        private CommandElement GetCommand(Office.IRibbonControl control)
        {
            CommandElement command = null;

            _commandIds.TryGetValue(control.Id, out command);
            return(command);
        }
Пример #2
0
 internal void InvalidateCommand(CommandElement command, bool forceUpdate)
 {
     _officeUI?.InvalidateControl(command.Id);
     if (forceUpdate)
     {
         _officeUI?.Invalidate();
         // TODO: sometimes if the focus is on another window, it is not updated.
     }
 }
Пример #3
0
        public string getControlSupertip(Office.IRibbonControl control)
        {
            CommandElement cmd = GetCommand(control);

            return(GetDataProvider(cmd).GetSuperTip(control.Id));
        }
Пример #4
0
        public string getControlLabel(Office.IRibbonControl control)
        {
            CommandElement cmd = GetCommand(control);

            return(GetDataProvider(cmd).GetLabel(control.Id));
        }
Пример #5
0
        public Bitmap getControlImage_normal(Office.IRibbonControl control)
        {
            CommandElement cmd = GetCommand(control);

            return(GetDataProvider(cmd).GetImage(control.Id, false));
        }
Пример #6
0
 private DataProvider GetDataProvider(CommandElement cmd)
 {
     return(cmd?.DataProvider ?? RESOURCE_DATA_PROVIDER);
 }