private System.ComponentModel.Design.DesignerTransaction CreateTransaction(object obj, string description)
        {
            IComponent component = obj as IComponent;

            if (component == null || component.Site == null)
            {
                return(null);
            }
            System.ComponentModel.Design.IDesignerHost designerHost = (System.ComponentModel.Design.IDesignerHost)component.Site.GetService(typeof(System.ComponentModel.Design.IDesignerHost));
            if (designerHost == null)
            {
                return(null);
            }
            System.ComponentModel.Design.DesignerTransaction     result = designerHost.CreateTransaction(description);
            System.ComponentModel.Design.IComponentChangeService componentChangeService = (System.ComponentModel.Design.IComponentChangeService)component.Site.GetService(typeof(System.ComponentModel.Design.IComponentChangeService));
            if (componentChangeService != null)
            {
                componentChangeService.OnComponentChanging(component, this);
            }
            return(result);
        }
 private void EndTransaction(object obj, System.ComponentModel.Design.DesignerTransaction tran, object oldValue, object newValue, bool commit)
 {
     if (tran == null)
     {
         this.OnValueChanged(obj, new PropertyChangedEventArgs(this.Name));
         return;
     }
     if (commit)
     {
         IComponent component = obj as IComponent;
         System.ComponentModel.Design.IComponentChangeService componentChangeService = (System.ComponentModel.Design.IComponentChangeService)component.Site.GetService(typeof(System.ComponentModel.Design.IComponentChangeService));
         if (componentChangeService != null)
         {
             componentChangeService.OnComponentChanged(component, this, oldValue, newValue);
         }
         tran.Commit();
         this.OnValueChanged(obj, new PropertyChangedEventArgs(this.Name));
     }
     else
     {
         tran.Cancel();
     }
 }