IDesignerHost.CreateTransaction 方法
定义
创建 DesignerTransaction,它可封装事件序列以提高性能并启用撤消和重复支持功能。Creates a DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality.
重载
| CreateTransaction() |
创建 DesignerTransaction,它可封装事件序列以提高性能并启用撤消和重复支持功能。Creates a DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality. |
| CreateTransaction(String) |
使用指定的事务说明创建 DesignerTransaction,它可封装事件序列以提高性能并启用撤消和重复支持功能。Creates a DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality, using the specified transaction description. |
CreateTransaction()
创建 DesignerTransaction,它可封装事件序列以提高性能并启用撤消和重复支持功能。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
返回
DesignerTransaction 的新实例。A new instance of DesignerTransaction. 在完成事务中的步骤后,应对此对象调用 Commit()。When you complete the steps in your transaction, you should call Commit() on this object.
注解
此方法创建 DesignerTransaction 可用于封装一系列操作的。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. 某些操作处理 TransactionOpening 和 TransactionClosed 事件,并且仅在事务未在进行时执行工作。Some operations handle the TransactionOpening and TransactionClosed events and perform work only when a transaction is not in progress. 有关使用事务的详细信息,请参阅的文档 DesignerTransaction 。For more information on using transactions, see the documentation for DesignerTransaction.
适用于
CreateTransaction(String)
使用指定的事务说明创建 DesignerTransaction,它可封装事件序列以提高性能并启用撤消和重复支持功能。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
参数
- description
- String
新创建的事务的标题或说明。A title or description for the newly created transaction.
返回
一个新的 DesignerTransaction。A new DesignerTransaction. 在完成事务中的步骤后,应对此对象调用 Commit()。When you have completed the steps in your transaction, you should call Commit() on this object.
注解
此方法创建 DesignerTransaction 可用于封装一系列操作的。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. 某些操作处理 TransactionOpening 和 TransactionClosed 事件,并且仅在事务未在进行时执行工作。Some operations handle the TransactionOpening and TransactionClosed events and perform work only when a transaction is not in progress. 有关使用事务的详细信息,请参阅的文档 DesignerTransaction 。For more information on using transactions, see the documentation for DesignerTransaction.