internal void SaveState(CommandSet.CommandSetItem item, int version)
 {
     this.selectionVersion = version;
     this.statusFlags = 0;
     if (item.Enabled)
     {
         this.statusFlags |= 1;
     }
     if (item.Visible)
     {
         this.statusFlags |= 2;
     }
     if (item.Checked)
     {
         this.statusFlags |= 4;
     }
     if (item.Supported)
     {
         this.statusFlags |= 8;
     }
 }
 public ImmediateCommandSetItem(CommandSet commandSet, EventHandler statusHandler, EventHandler invokeHandler, CommandID id, IUIService uiService)
     : base(commandSet, statusHandler, invokeHandler, id, uiService)
 {
 }
 internal void ApplyState(CommandSet.CommandSetItem item)
 {
     item.Enabled = (this.statusFlags & 1) == 1;
     item.Visible = (this.statusFlags & 2) == 2;
     item.Checked = (this.statusFlags & 4) == 4;
     item.Supported = (this.statusFlags & 8) == 8;
 }
 public CommandSetItem(CommandSet commandSet, EventHandler statusHandler, EventHandler invokeHandler, CommandID id, bool optimizeStatus, IUIService uiService)
     : base(invokeHandler, id)
 {
     this.uiService = uiService;
     this.eventService = commandSet.eventService;
     this.statusHandler = statusHandler;
     if (optimizeStatus && (statusHandler != null))
     {
         this.commandSet = commandSet;
         lock (typeof(CommandSet.CommandSetItem))
         {
             if (commandStatusHash == null)
             {
                 commandStatusHash = new Hashtable();
             }
         }
         StatusState state = commandStatusHash[statusHandler] as StatusState;
         if (state == null)
         {
             state = new StatusState();
             commandStatusHash.Add(statusHandler, state);
         }
         state.refCount++;
     }
 }
 public CommandSetItem(CommandSet commandSet, EventHandler statusHandler, EventHandler invokeHandler, CommandID id, IUIService uiService)
     : this(commandSet, statusHandler, invokeHandler, id, false, uiService)
 {
 }
 public CommandSetItem(CommandSet commandSet, EventHandler statusHandler, EventHandler invokeHandler, CommandID id, bool optimizeStatus)
     : this(commandSet, statusHandler, invokeHandler, id, optimizeStatus, null)
 {
 }
 public CommandSetItem(CommandSet commandSet, EventHandler statusHandler, EventHandler invokeHandler, CommandID id)
     : this(commandSet, statusHandler, invokeHandler, id, false, null)
 {
 }