AddInController.AppDomain Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the application domain that contains an add-in.

Namespace:   System.AddIn.Hosting
Assembly:  System.AddIn (in System.AddIn.dll)

public AppDomain AppDomain { get; }

Property Value

Type: System.AppDomain

The application domain of the add-in.

Use this property to obtain an add-in's AppDomain object and to activate other add-ins in the same application domain.

The following example activates a second add-in in the same application domain as the first add-in.

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

.NET Framework
Available since 3.5
Return to top
Show: