Aracılığıyla paylaş


AddInProcess.IsCurrentProcess Özellik

Tanım

Geçerli AddInProcess nesnenin konak uygulama işlemini temsil edip etmediğini gösteren bir değer alır.

public:
 property bool IsCurrentProcess { bool get(); };
public bool IsCurrentProcess { get; }
member this.IsCurrentProcess : bool
Public ReadOnly Property IsCurrentProcess As Boolean

Özellik Değeri

true nesne geçerli AddInProcess işleme karşılık geliyorsa; değilse, false.

Örnekler

Aşağıdaki örnek, dış işlemdeki bir eklentiyi etkinleştirir ve eklentinin IsCurrentProcess konak uygulama işlemiyle aynı işlemde olup olmadığını belirlemek için özelliğini kullanır.

// Create an external process.
AddInProcess pExternal = new AddInProcess();

// Activate an add-in in the external process
// with a full trust security level.
Calculator CalcAddIn4 =
    selectedToken.Activate<Calculator>(pExternal,
    AddInSecurityLevel.FullTrust);

// Show that the add-in is an external process
// by verifying that it is not in the current (host's) process.
AddInController AddinCtl = AddInController.GetAddInController(CalcAddIn4);
Console.WriteLine("Add-in in host's process: {0}",
    AddinCtl.AddInEnvironment.Process.IsCurrentProcess);
' Create an external process.
Dim pExternal As New AddInProcess()

' Activate an add-in in the external process
' with a full trust security level.
Dim CalcAddIn4 As Calculator = _
    selectedToken.Activate(Of Calculator)(pExternal, _
        AddInSecurityLevel.FullTrust)

' Show that the add-in is an external process
' by verifying that it is not in the current (host's) process.
Dim AddinCtl As AddInController = AddInController.GetAddInController(CalcAddIn4)
Console.WriteLine("Add-in in host's process: {0}", _
 AddinCtl.AddInEnvironment.Process.IsCurrentProcess)

Açıklamalar

Bu özelliğin değeri ise true, eklenti konak uygulamasıyla birlikte çalışırken çalışır. Bu durumda, veya Shutdown yönteminin kullanılması Start bir InvalidOperationExceptionoluşturur.

Not

özelliği, AddInEnvironment.Process eklenti işlem içinde çalışıyorsa konak uygulama işlemini temsil eden bir AddInProcess nesne döndürür.

Şunlara uygulanır