System.ComponentModel.Design.DesignerTransaction.Cancel C# (CSharp) Method

Cancel() public method

public Cancel ( ) : void
return void
        public void Cancel() {
            if (!canceled && !committed) {
                canceled = true;
                GC.SuppressFinalize(this);
                suppressedFinalization = true;
                OnCancel();
            }
        }
    

Usage Example

 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();
     }
 }
All Usage Examples Of System.ComponentModel.Design.DesignerTransaction::Cancel