Teilen über


AddInController.AppDomain Eigenschaft

Definition

Ruft die Anwendungsdomäne ab, die ein Add-In enthält.

public:
 property AppDomain ^ AppDomain { AppDomain ^ get(); };
public AppDomain AppDomain { get; }
member this.AppDomain : AppDomain
Public ReadOnly Property AppDomain As AppDomain

Eigenschaftswert

Die Anwendungsdomäne des Add-Ins.

Beispiele

Im folgenden Beispiel wird ein zweites Add-In in derselben Anwendungsdomäne wie das erste Add-In aktiviert.

// Get the application domain
// of an existing add-in (CalcAddIn).
AddInController aiCtrl = AddInController.GetAddInController(CalcAddIn);
AppDomain AddInAppDom = aiCtrl.AppDomain;

// Activate another add-in in the same application domain.
Calculator CalcAddIn3 =
    selectedToken2.Activate<Calculator>(AddInAppDom);

// Show that CalcAddIn3 was loaded
// into CalcAddIn's application domain.
AddInController aic = AddInController.GetAddInController(CalcAddIn3);
Console.WriteLine("Add-in loaded into existing application domain: {0}",
    aic.AppDomain.Equals(AddInAppDom));
' Get the application domain
' of an existing add-in (CalcAddIn).

Dim aiCtrl As AddInController = AddInController.GetAddInController(CalcAddIn)
Dim AddInAppDom As AppDomain = aiCtrl.AppDomain

' Activate another add-in in the same appliation domain.
Dim CalcAddIn3 As Calculator = selectedToken2.Activate(Of Calculator)(AddInAppDom)

' Show that the CalcAddIn3 was loaded
' into CalcCaddIn's application domain.
Dim aic As AddInController = AddInController.GetAddInController(CalcAddIn3)
Console.WriteLine("Add-in loaded into existing application domain: {0}", _
 aic.AppDomain.Equals(AddInAppDom))

Hinweise

Verwenden Sie diese Eigenschaft, um das Objekt eines Add-Ins AppDomain abzurufen und andere Add-Ins in derselben Anwendungsdomäne zu aktivieren.

Gilt für: