Beispiel #1
0
 protected void OnCommandChanged(CommandChangedEventArgs e)
 {
     if (this.CommandChanged == null)
     {
         return;
     }
     this.CommandChanged((object)this, e);
 }
Beispiel #2
0
        private void Target_CommandChanged(object sender, CommandChangedEventArgs e)
        {
            ICommandTarget target = (ICommandTarget)sender;

            foreach (string commandName in (IEnumerable)e.Added)
            {
                this.targets.Add(commandName, target);
            }
            foreach (string commandName in (IEnumerable)e.Removed)
            {
                this.targets.Remove(commandName, target);
            }
            this.OnCommandChanged(e);
        }
Beispiel #3
0
        protected virtual void OnCommandChanged(CommandChangedEventArgs e)
        {
            if (this.CommandChanged == null)
            {
                return;
            }
            CommandCollection commandCollection1 = new CommandCollection();
            CommandCollection commandCollection2 = new CommandCollection();

            foreach (string command in (IEnumerable)e.Added)
            {
                commandCollection1.Add(command);
            }
            foreach (string str in (IEnumerable)e.Removed)
            {
                commandCollection2.Add(str);
                if (this.targets.GetTarget(str) == null)
                {
                    commandCollection1.Add(str);
                }
            }
            this.CommandChanged((object)this, new CommandChangedEventArgs((ICommandCollection)commandCollection1, (ICommandCollection)commandCollection2));
        }