ResourceScope 枚举

定义

标识可共享资源的范围。Identifies the scope of a sharable resource.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

此 API 支持产品基础结构,不能在代码中直接使用。

public enum class ResourceScope
[System.Flags]
public enum ResourceScope
type ResourceScope = 
Public Enum ResourceScope
继承
ResourceScope
属性

字段

AppDomain 4

该状态由 AppDomain 中的对象共享。The state is shared by objects within an AppDomain.

Assembly 32

该资源在程序集范围内可见。The resource is visible at an assembly scope.

Library 8

该状态由库中的对象共享。The state is shared by objects within a library.

Machine 1

该状态由计算机中的对象共享。The state is shared by objects within the machine.

None 0

不存在共享的状态。There is no shared state.

Private 16

该资源仅对该类型可见。The resource is visible to only the type.

Process 2

该状态在进程内共享。The state is shared within a process.

注解

资源是保存状态的对象。A resource is an object that holds state. 资源的示例包括磁盘上的文件、进程的消息队列和名为Mutex的。Examples of resources include a file on disk, a message queue for a process, and a named Mutex. 知道对象是一种不表示其适当用途的资源,资源的重要属性是资源的作用域。Knowing an object is a resource does not indicate its appropriate use; the important property of a resource is the scope of the resource. 范围包括资源的类型和可见性。The scope includes both the type and the visibility of the resource. 资源类型指定资源是否为计算机级别的资源, 例如磁盘上的文件、进程范围的资源 (例如非共享内存块) 或应用程序域级别的资源 (如按引用对非封送的实例进行锁定)对象.The resource type specifies whether the resource is a machine-level resource, such as a file on disk, a process-wide resource, such as a block of non-shared memory, or an application domain-level resource, such as a lock on an instance of a non-marshal by reference object. 可见性范围为 Assembly 和 Private, 默认值为Public, 如果不指示私有或程序集, 则为隐式。The visibility scopes are Assembly and Private, the default is Public, which is implicit if Private or Assembly are not indicated. 没有枚举值PublicThere is no enumeration value for Public.

适用于