AddInController.AppDomain 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取包含外接程序的应用程序域。
public:
property AppDomain ^ AppDomain { AppDomain ^ get(); };
public AppDomain AppDomain { get; }
member this.AppDomain : AppDomain
Public ReadOnly Property AppDomain As AppDomain
属性值
外接程序的应用程序域。
示例
以下示例激活与第一个外接程序相同的应用程序域中的第二个外接程序。
// 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))
注解
使用此属性可获取加载项的对象 AppDomain 并激活同一应用程序域中的其他加载项。