System.ComponentModel.Design.IDesignerHost.CreateTransaction Method

Creates a System.ComponentModel.Design.DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality.

Syntax

public DesignerTransaction CreateTransaction ()

Returns

A new instance of System.ComponentModel.Design.DesignerTransaction. When you complete the steps in your transaction, you should call DesignerTransaction.Commit on this object.

Remarks

This method creates a System.ComponentModel.Design.DesignerTransaction that can be used to encapsulate a series of operations. Designer transactions can improve performance, reduce flicker caused by multiple updates during a process of operations, and enable most operations to be undone.

Lengthy operations that involve multiple components can raise many events. These events can cause side effects, such as flicker or degraded performance. When operating on multiple components at one time, or setting multiple properties on a single component, you can improve performance by performing these changes within a transaction. Some operations handle the IDesignerHost.TransactionOpening and IDesignerHost.TransactionClosed events and perform work only when a transaction is not in progress. For more information on using transactions, see the documentation for System.ComponentModel.Design.DesignerTransaction.

Requirements

Namespace: System.ComponentModel.Design
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0