示例#1
0
 /// <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;
 }
示例#2
0
 /// <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);
 }
示例#3
0
 /// <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;
 }
示例#4
0
 /// <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;
 }
示例#5
0
        public static ICommandSource FindCommandSource([NotNull] Component component)
        {
            CommandSources.TryGetValue(component, out var source);

            return(source);
        }