private CommandElement GetCommand(Office.IRibbonControl control) { CommandElement command = null; _commandIds.TryGetValue(control.Id, out command); return(command); }
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. } }
public string getControlSupertip(Office.IRibbonControl control) { CommandElement cmd = GetCommand(control); return(GetDataProvider(cmd).GetSuperTip(control.Id)); }
public string getControlLabel(Office.IRibbonControl control) { CommandElement cmd = GetCommand(control); return(GetDataProvider(cmd).GetLabel(control.Id)); }
public Bitmap getControlImage_normal(Office.IRibbonControl control) { CommandElement cmd = GetCommand(control); return(GetDataProvider(cmd).GetImage(control.Id, false)); }
private DataProvider GetDataProvider(CommandElement cmd) { return(cmd?.DataProvider ?? RESOURCE_DATA_PROVIDER); }