public UndoUnit(System.ComponentModel.Design.UndoEngine engine, string name)
            {
                if (engine == null)
                {
                    throw new ArgumentNullException("engine");
                }
                if (name == null)
                {
                    name = string.Empty;
                }
                this._name    = name;
                this._engine  = engine;
                this._reverse = true;
                ISelectionService service = this._engine.GetService(typeof(ISelectionService)) as ISelectionService;

                if (service != null)
                {
                    ICollection selectedComponents = service.GetSelectedComponents();
                    Hashtable   hashtable          = new Hashtable();
                    foreach (object obj2 in selectedComponents)
                    {
                        IComponent component = obj2 as IComponent;
                        if ((component != null) && (component.Site != null))
                        {
                            hashtable[component.Site.Name] = component.Site.Container;
                        }
                    }
                    this._lastSelection = hashtable;
                }
            }
 public UndoUnit(System.ComponentModel.Design.UndoEngine engine, string name)
 {
     if (engine == null)
     {
         throw new ArgumentNullException("engine");
     }
     if (name == null)
     {
         name = string.Empty;
     }
     this._name = name;
     this._engine = engine;
     this._reverse = true;
     ISelectionService service = this._engine.GetService(typeof(ISelectionService)) as ISelectionService;
     if (service != null)
     {
         ICollection selectedComponents = service.GetSelectedComponents();
         Hashtable hashtable = new Hashtable();
         foreach (object obj2 in selectedComponents)
         {
             IComponent component = obj2 as IComponent;
             if ((component != null) && (component.Site != null))
             {
                 hashtable[component.Site.Name] = component.Site.Container;
             }
         }
         this._lastSelection = hashtable;
     }
 }