Redigera

Dela via


IDesignerHost.CreateTransaction Method

Definition

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

Overloads

CreateTransaction()

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

CreateTransaction(String)

Creates a DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality, using the specified transaction description.

CreateTransaction()

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

public:
 System::ComponentModel::Design::DesignerTransaction ^ CreateTransaction();
public System.ComponentModel.Design.DesignerTransaction CreateTransaction ();
abstract member CreateTransaction : unit -> System.ComponentModel.Design.DesignerTransaction
Public Function CreateTransaction () As DesignerTransaction

Returns

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

Remarks

This method creates a 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 TransactionOpening and TransactionClosed events and perform work only when a transaction is not in progress. For more information on using transactions, see the documentation for DesignerTransaction.

Applies to

CreateTransaction(String)

Creates a DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality, using the specified transaction description.

public:
 System::ComponentModel::Design::DesignerTransaction ^ CreateTransaction(System::String ^ description);
public System.ComponentModel.Design.DesignerTransaction CreateTransaction (string description);
abstract member CreateTransaction : string -> System.ComponentModel.Design.DesignerTransaction
Public Function CreateTransaction (description As String) As DesignerTransaction

Parameters

description
String

A title or description for the newly created transaction.

Returns

A new DesignerTransaction. When you have completed the steps in your transaction, you should call Commit() on this object.

Remarks

This method creates a 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 TransactionOpening and TransactionClosed events and perform work only when a transaction is not in progress. For more information on using transactions, see the documentation for DesignerTransaction.

Applies to