允许由 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
Enter 和Leave方法成对使用来包围代码, 然后即可使用 com + 服务。The Enter and Leave methods are used in pairs to surround code that can then use COM+ services. 在对的调用Enter和Leave在其自身的上下文中运行的代码, 并表现为在上下文中创建的对象上调用的方法。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. Enter 和Leave对可以嵌套。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.
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.(继承自 Object)
用作默认哈希函数。Serves as the default hash function.(继承自 Object)
触发服务器端的策略，随后触发客户端的策略，如同一个方法调用正在返回。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.
返回表示当前对象的字符串。Returns a string that represents the current object.(继承自 Object)