Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CellentCommand" /> class.
 /// </summary>
 /// <param name="executeMethod">The execute method.</param>
 /// <param name="canExecuteMethod">The can execute methhod.</param>
 /// <param name="right">The right.</param>
 public CellentCommand(Action executeMethod, Func <bool> canExecuteMethod, ClientRights right)
     : base(executeMethod, () =>
 {
     //hm. ist das elegant? Vielleicht eine passendere Basiklasse suchen.
     bool isAvailable = ClientContext.ClientRights.Contains(right);
     if (!isAvailable)
     {
         return(false);
     }
     return(canExecuteMethod.Invoke());
 })
 {
     IsAvailable = ClientContext.ClientRights.Contains(right);
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CellentCommand" /> class.
 /// </summary>
 /// <param name="executeMethod">The execute method.</param>
 /// <param name="right">The right.</param>
 public CellentCommand(Action <T> executeMethod, ClientRights right) : base(executeMethod, arg => ClientContext.ClientRights.Contains(right))
 {
     IsAvailable = ClientContext.ClientRights.Contains(right);
 }