Share via


ContextUtil.ContextId プロパティ

定義

現在のコンテキストの GUID を取得します。

public:
 static property Guid ContextId { Guid get(); };
public static Guid ContextId { get; }
static member ContextId : Guid
Public Shared ReadOnly Property ContextId As Guid

プロパティ値

現在のコンテキストの GUID。

例外

使用できる COM+ コンテキストはありません。

次のコード例は、この属性の使用方法を示しています。

protected:
   virtual void Activate() override
   {
      MessageBox::Show( String::Format( "Now entering...\nApplication: {0}\nInstance: {1}\nContext: {2}\n", ContextUtil::ApplicationId.ToString(), ContextUtil::ApplicationInstanceId.ToString(), ContextUtil::ContextId.ToString() ) );
   }
protected override void Activate()
{
    MessageBox.Show( String.Format("Now entering...\nApplication: {0}\nInstance: {1}\nContext: {2}\n",
                                   ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(),
                                   ContextUtil.ContextId.ToString() ) );
}
Protected Overrides Sub Activate() 
    MessageBox.Show(String.Format("Now entering..." + vbLf + "Application: {0}" + vbLf + "Instance: {1}" + vbLf + "Context: {2}" + vbLf, ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(), ContextUtil.ContextId.ToString()))

End Sub

適用対象