Exemple #1
0
 /// <summary>
 /// This method will notify the command container when a commands is added or removed.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="remove">Set this to true to remove the command mapping, false is default.</param>
 protected virtual void CommandNotify(CommandHolder key, bool remove = false, bool isQuorum = false)
 {
     try
     {
         OnCommandChange?.Invoke(this, new CommandChange(remove, key.Message, isQuorum));
     }
     catch (Exception ex)
     {
         Logger?.LogException($"Command {GetType().Name} Change Notification failed", ex);
     }
 }
 /// <summary>
 /// This message is fired when a command status changes.
 /// </summary>
 /// <param name="messages">The message list to pass to the event.</param>
 public void NotifyChange(List <MessageFilterWrapper> messages)
 {
     try
     {
         OnCommandChange?.Invoke(this, new SupportedMessagesChangeEventArgs(mSupportedMessageTypes()));
     }
     catch
     {
         //We don't throw errors here.
     }
 }
 /// <summary>
 /// This message is fired when a command status changes.
 /// </summary>
 /// <param name="messages"></param>
 public void NotifyChange(List <MessageFilterWrapper> messages)
 {
     try
     {
         OnCommandChange?.Invoke(this, new SupportedMessagesChange()
         {
             Messages = mSupportedMessageTypes()
         });
     }
     catch (Exception ex)
     {
         //Collector?.
     }
 }