AddInProcess Class

AddInProcess Class

 

Provides an external process for running add-ins out-of-process from the host application.

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

System.Object
  System.AddIn.Hosting.AddInProcess

public sealed class AddInProcess

NameDescription
System_CAPS_pubmethodAddInProcess()

Initializes a new instance of the AddInProcess class.

System_CAPS_pubmethodAddInProcess(Platform)

Initializes a new instance of the AddInProcess class, specifying the bits-per-word of the process in which the add-in runs.

NameDescription
System_CAPS_pubpropertyIsCurrentProcess

Gets a value that indicates whether the currentAddInProcess object represents the host application process.

System_CAPS_pubpropertyKeepAlive

Gets or sets a value that indicates whether to keep the external process alive.

System_CAPS_pubpropertyPlatform

Gets the bits-per-word of the process in which the out-of-process add-in is run.

System_CAPS_pubpropertyProcessId

Gets the process ID of the external process.

System_CAPS_pubpropertyStartupTimeout

Gets or sets the number of seconds to allow for the process to start.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodShutdown()

Forcibly shuts down the external process.

System_CAPS_pubmethodStart()

Starts the external process.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubeventShuttingDown

Occurs when the process represented by the AddInProcess object is about to be shut down.

To activate an add-in in an external process, pass an AddInProcess object to the appropriate AddInToken.Activate<T>(AddInProcess, PermissionSet) method overload.

The executable that runs the add-in is obtained from one of two files installed with the .NET Framework under the Windows directory. By default, the executable that matches the bits-per-word of the host application is used. If the host is a 64-bit process, AddInProcess.exe is run; otherwise, AddInProcess32.exe is run. To specify the way the executable is selected, use the AddInProcess(Platform) constructor to create the AddInProcess object.

The following example activates an add-in in an external process.

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

.NET Framework
Available since 3.5

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft