ServiceDomain 类

定义

允许由 Enter(ServiceConfig)Leave() 标识的代码段在其自身的上下文中运行,其行为如同在此上下文中创建的对象上调用的方法。Allows a code segment identified by Enter(ServiceConfig) and Leave() to run in its own context and behave as if it were a method that is called on an object created within the context. 此类不能被继承。This class cannot be inherited.

public ref class ServiceDomain sealed
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class ServiceDomain
type ServiceDomain = class
Public NotInheritable Class ServiceDomain
继承
ServiceDomain
属性

注解

EnterLeave方法成对使用来包围代码, 然后即可使用 com + 服务。The Enter and Leave methods are used in pairs to surround code that can then use COM+ services. 在对的调用EnterLeave在其自身的上下文中运行的代码, 并表现为在上下文中创建的对象上调用的方法。Code that is enclosed between calls to Enter and Leave runs in its own context and behaves as if it were a method that is called on an object created within the context. EnterLeave对可以嵌套。The Enter and Leave pairs can be nested. 用户需要确保对调用进行平衡, 以便每个调用Leave都与之前对的Enter调用匹配。It is up to the user to make sure that pairs of calls are balanced so that every call to Leave matches a previous call to Enter.

方法

Enter(ServiceConfig)

创建由 ServiceConfig 对象指定的上下文,并将其推至上下文堆栈,使之成为当前上下文。Creates the context specified by the ServiceConfig object and pushes it onto the context stack to become the current context.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Leave()

触发服务器端的策略,随后触发客户端的策略,如同一个方法调用正在返回。Triggers the server and then the client side policies as if a method call were returning. 然后,当前上下文被弹出上下文堆栈,调用 Enter(ServiceConfig) 时正在运行的上下文成为当前的上下文。The current context is then popped from the context stack, and the context that was running when Enter(ServiceConfig) was called becomes the current context.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于