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 載入宏的物件,並啟用相同應用程式域中的其他載入宏。