TransactionManager.BeginTransaction メソッド (String, Boolean, TransactionContext)

指定した名前で新しいトランザクション オブジェクトを作成し、オブジェクトへの参照を返します

名前空間:  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
)

パラメーター

  • isSerializing
    型 : System.Boolean
    transaction.IsSerializing の値が決まります。 true は、モデルがファイルから読み取られるいることを示します。

戻り値

型 : Microsoft.VisualStudio.Modeling.Transaction
Transaction オブジェクト。

解説

トランザクションのコンテキスト オブジェクトに渡される情報を使用するイベント ハンドラーと規則を作成する場合はこのバージョンを使用します。規則がトランザクションが終了した任意の順序で呼び出されるため、アプリケーション間で情報を渡すことができる直接ことはできません。トランザクション コンテキストは、型情報は渡すことができるディクショナリです。

// In a rule:
UsefulInfo info = this.Store.TransactionManager.CurrentTransaction
    .TopLevelTransaction.Context.ContextInfo["akey"] as UsefulInfo;

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

TransactionManager クラス

BeginTransaction オーバーロード

Microsoft.VisualStudio.Modeling 名前空間