ActivationOption ActivationOption ActivationOption ActivationOption Enum

定义

指定在应用程序中激活已维护的组件的方式。Specifies the manner in which serviced components are activated in the application.

public enum class ActivationOption
[System.Serializable]
public enum ActivationOption
type ActivationOption = 
Public Enum ActivationOption
继承
ActivationOptionActivationOptionActivationOptionActivationOption
属性

字段

Library Library Library Library 0

指定在创建者的进程中激活标记的应用程序中的已维护的组件。Specifies that serviced components in the marked application are activated in the creator's process.

Server Server Server Server 1

指定在系统提供的进程中激活标记的应用程序中的已维护的组件。Specifies that serviced components in the marked application are activated in a system-provided process.

示例

下面的代码示例演示如何使用此枚举。The following code example demonstrates the use of this enumeration.


[assembly:ApplicationName("Calculator")];
[assembly:ApplicationActivation(ActivationOption::Library)];
[assembly:System::Reflection::AssemblyKeyFile("Calculator.snk")];
public ref class Calculator: public ServicedComponent
{
public:
   int Add( int x, int y )
   {
      return (x + y);
   }

};

using System;
using System.EnterpriseServices;

[assembly: ApplicationName("Calculator")]
[assembly: ApplicationActivation(ActivationOption.Library)]
[assembly: System.Reflection.AssemblyKeyFile("Calculator.snk")]
public class Calculator : ServicedComponent
{
    public int Add (int x, int y)
    {
        return(x+y);
    }
}

注解

应用程序的激活设置默认为LibraryThe activation setting for the application defaults to Library.

适用于