/// <summary> /// ribbon command init /// </summary> /// <param name="commandId"></param> /// <param name="ribbonPath"></param> /// <param name="source"></param> /// <param name="checkForViewId"></param> public UICommand(string commandId, string ribbonPath, CommandSources source, string checkForViewId ) { this._conditions = new List <ICondition>(); this._commandId = commandId; this._ribbonPath = ribbonPath; this._source = source; this._checkForViewId = checkForViewId; }
/// <summary> /// dynamic command init /// </summary> /// <param name="commandId"></param> /// <param name="source"></param> /// <param name="checkForViewId"></param> /// <param name="item"></param> /// <param name="action"></param> /// <param name="groupName"></param> public UICommand(string commandId, CommandSources source, string ribbonPath, BarItem item, ICommand action, IEnumerable <ICondition> conditions, string groupName) { this._conditions = new List <ICondition>(); this._commandId = commandId; this._ribbonPath = string.Empty; this._source = source; this._checkForViewId = string.Empty; this._ribbonPath = ribbonPath; this._barItem = item; this._actionCommand = action; this.BarItem.ItemClick += _barItem_ItemClick; this._groupName = groupName; this._conditions.AddRange(conditions); }
/// <summary> /// custom command init /// </summary> /// <param name="commandId"></param> /// <param name="source"></param> /// <param name="checkForViewId"></param> /// <param name="item"></param> /// <param name="action"></param> public UICommand(string commandId, CommandSources source, string checkForViewId, BarItem item, ICommand action, IEnumerable <ICondition> conditions, IControllerFinder finder ) { this._controllerFinder = finder; this._conditions = new List <ICondition>(); this._commandId = commandId; this._ribbonPath = string.Empty; this._source = source; this._checkForViewId = checkForViewId; this._barItem = item; this._actionCommand = action; this._conditions.AddRange(conditions); this.BarItem.ItemClick += _barItem_ItemClick; }
/// <summary> /// dynamic command init /// </summary> /// <param name="commandId"></param> /// <param name="source"></param> /// <param name="checkForViewId"></param> /// <param name="item"></param> /// <param name="action"></param> /// <param name="groupName"></param> public UICommand(string commandId, CommandSources source, BarSubItem item, ICommand action, IEnumerable <ICondition> conditions, string groupName, IRunTimeCommandRigister cmdRegister, IControllerFinder finder) { this._conditions = new List <ICondition>(); this._commandId = commandId; this._ribbonPath = string.Empty; this._source = source; this._checkForViewId = string.Empty; this._ribbonPath = string.Empty; this._barItem = item; this._actionCommand = action; this.BarItem.ItemClick += _barItem_ItemClick; this._groupName = groupName; this._conditions.AddRange(conditions); this._runTimeCommandRigister = cmdRegister; this._controllerFinder = finder; }
public static ICommandSource FindCommandSource([NotNull] Component component) { CommandSources.TryGetValue(component, out var source); return(source); }