/// <include file='doc\ObjectListShowCommandsEventArgs.uex' path='docs/doc[@for="ObjectListShowCommandsEventArgs.ObjectListShowCommandsEventArgs"]/*' />
 public ObjectListShowCommandsEventArgs(ObjectListItem item, ObjectListCommandCollection commands)
 {
     _item = item;
     _commands = commands;
 }
        /// <include file='doc\ObjectList.uex' path='docs/doc[@for="ObjectList.PreShowItemCommands"]/*' />
        public void PreShowItemCommands(int itemIndex)
        {
            // Called just before commands are shown for a given item. We call 
            // an event handler that can modify (or even replace) the commands collection,
            // but first we mark the collection, and save it off, so that we can 
            // save the state of the collection at this point.

            if (_commands != null)
            {
                _globalCommands = _commands;
                _commands.GlobalStateSet();
            }

            SelectedIndex = itemIndex;

            ObjectListShowCommandsEventArgs eventArgs = 
                new ObjectListShowCommandsEventArgs(Selection, Commands);
            OnShowItemCommands(eventArgs);
            if (eventArgs.Commands != _commands)
            {
                _commands = eventArgs.Commands;
            }
        }
 /// <include file='doc\ObjectListShowCommandsEventArgs.uex' path='docs/doc[@for="ObjectListShowCommandsEventArgs.ObjectListShowCommandsEventArgs"]/*' />
 public ObjectListShowCommandsEventArgs(ObjectListItem item, ObjectListCommandCollection commands)
 {
     _item     = item;
     _commands = commands;
 }