AddInProcess.IsCurrentProcess Eigenschap

Definitie

Hiermee wordt een waarde opgehaald die aangeeft of het huidige AddInProcess object het hosttoepassingsproces vertegenwoordigt.

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

Waarde van eigenschap

trueals het AddInProcess object overeenkomt met het huidige proces; anders. false

Voorbeelden

In het volgende voorbeeld wordt een invoegtoepassing geactiveerd in een extern proces en wordt de IsCurrentProcess eigenschap gebruikt om te bepalen of de invoegtoepassing zich in hetzelfde proces bevindt als het hosttoepassingsproces.

// 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)

Opmerkingen

Als de waarde van deze eigenschap is true, wordt de invoegtoepassing in verwerking uitgevoerd met de hosttoepassing. In dat geval genereert het gebruik van de Start of Shutdown methode een InvalidOperationException.

Note

De AddInEnvironment.Process eigenschap retourneert een AddInProcess object dat het hosttoepassingsproces vertegenwoordigt als de invoegtoepassing wordt uitgevoerd.

Van toepassing op