指定した名前で新しいトランザクション オブジェクトを作成し、オブジェクトへの参照を返します
名前空間: Microsoft.VisualStudio.Modeling
アセンブリ: Microsoft.VisualStudio.Modeling.Sdk.11.0 (Microsoft.VisualStudio.Modeling.Sdk.11.0.dll 内)
構文
'宣言
Public Function BeginTransaction ( _
name As String, _
isSerializing As Boolean, _
context As TransactionContext _
) As Transaction
public Transaction BeginTransaction(
string name,
bool isSerializing,
TransactionContext context
)
パラメーター
- name
型 : System.String
トランザクションの名前。
- isSerializing
型 : System.Boolean
transaction.IsSerializing の値が決まります。 true は、モデルがファイルから読み取られるいることを示します。
- context
型 : Microsoft.VisualStudio.Modeling.TransactionContext
トランザクション中に使用できるトランザクションのコンテキスト オブジェクト。
戻り値
型 : Microsoft.VisualStudio.Modeling.Transaction
Transaction オブジェクト。
解説
トランザクションのコンテキスト オブジェクトに渡される情報を使用するイベント ハンドラーと規則を作成する場合はこのバージョンを使用します。規則がトランザクションが終了した任意の順序で呼び出されるため、アプリケーション間で情報を渡すことができる直接ことはできません。トランザクション コンテキストは、型情報は渡すことができるディクショナリです。
例
// In a rule:
UsefulInfo info = this.Store.TransactionManager.CurrentTransaction
.TopLevelTransaction.Context.ContextInfo["akey"] as UsefulInfo;
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。