AddInProcess Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides an external process for running add-ins out-of-process from the host application.
public ref class AddInProcess sealed
public sealed class AddInProcess
type AddInProcess = class
Public NotInheritable Class AddInProcess
- Inheritance
-
AddInProcess
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 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);
' Create an external process.
Dim pExternal As New AddInProcess()
' Activate an add-in in the external process
' with a full trust security level.
Dim CalcAddIn4 As Calculator = _
selectedToken.Activate(Of Calculator)(pExternal, _
AddInSecurityLevel.FullTrust)
' Show that the add-in is an external process
' by verifying that it is not in the current (host's) process.
Dim AddinCtl As AddInController = AddInController.GetAddInController(CalcAddIn4)
Console.WriteLine("Add-in in host's process: {0}", _
AddinCtl.AddInEnvironment.Process.IsCurrentProcess)
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.
Add |
Initializes a new instance of the AddInProcess class. |
Add |
Initializes a new instance of the AddInProcess class, specifying the bits-per-word of the process in which the add-in runs. |
Is |
Gets a value that indicates whether the current AddInProcess object represents the host application process. |
Keep |
Gets or sets a value that indicates whether to keep the external process alive. |
Platform |
Gets the bits-per-word of the process in which the out-of-process add-in is run. |
Process |
Gets the process ID of the external process. |
Startup |
Gets or sets the number of seconds to allow for the process to start. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Shutdown() |
Forcibly shuts down the external process. |
Start() |
Starts the external process. |
To |
Returns a string that represents the current object. (Inherited from Object) |
Shutting |
Occurs when the process represented by the AddInProcess object is about to be shut down. |
Toode | Versioonid |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Toote „.NET“ tagasiside
.NET on avatud lähtekoodiga projekt. Tagasiside andmiseks valige link: