Beispiel #1
0
 private void Command_OnCommandChange(object sender, CommandChangeEventArgs e)
 {
     if (e.IsRemoval)
     {
         if (RegisteredCommands.ContainsKey(e.Key))
         {
             RegisteredCommands.Remove(e.Key);
         }
     }
     else
     {
         RegisteredCommands.Add(e.Key, e.IsMasterJob);
     }
 }
        /// <summary>
        /// This event is fired when a dymanic command changes the supported commands.
        /// This might happen specifically when a master job becomes active.
        /// </summary>
        /// <param name="sender">The command which changes.</param>
        /// <param name="e">The change parameters.</param>
        private void Internal_OnCommandChange(object sender, CommandChangeEventArgs e)
        {
            //Clear the message map cache as the cache is no longer valid due to removal.
            if (e.IsRemoval)
            {
                mMessageMap.Clear();
            }

            //Check that we current support notifications. This is disabled during startup.
            if (mNotificationsActive)
            {
                //Notify the relevant parties (probably just communication) to refresh what they are doing.
                mHandlersCollection.NotifyChange(SupportedMessageTypes());
            }
        }