KeyContainerPermissionAccessEntryEnumerator 类     
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
Code Access Security is not supported or honored by the runtime.
public ref class KeyContainerPermissionAccessEntryEnumerator sealed : System::Collections::IEnumerator[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class KeyContainerPermissionAccessEntryEnumerator : System.Collections.IEnumerator[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public sealed class KeyContainerPermissionAccessEntryEnumerator : System.Collections.IEnumeratorpublic sealed class KeyContainerPermissionAccessEntryEnumerator : System.Collections.IEnumerator[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type KeyContainerPermissionAccessEntryEnumerator = class
    interface IEnumerator[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type KeyContainerPermissionAccessEntryEnumerator = class
    interface IEnumeratortype KeyContainerPermissionAccessEntryEnumerator = class
    interface IEnumeratorPublic NotInheritable Class KeyContainerPermissionAccessEntryEnumerator
Implements IEnumerator- 继承
- 
				KeyContainerPermissionAccessEntryEnumerator
- 属性
- 实现
注解
注意
代码访问安全性 (CAS) 已在所有版本的 .NET Framework 和 .NET 中弃用。 如果使用与 CAS 相关的 API,最新版本的 .NET 不会遵循 CAS 注释,并会生成错误。 开发人员应寻求用于完成安全任务的替代方法。
枚举器仅允许读取集合中的数据。 枚举器不能用于修改基础集合。
最初,枚举数定位在集合中第一个元素的前面。 方法 Reset 还会将枚举器带回此位置。 在此位置,调用 Current 属性将引发异常。 因此,在读取 属性的值Current之前,必须调用 MoveNext 方法将枚举器推进到集合的第一个元素。
在调用 Current 或 MoveNext 之前,Reset 返回同一对象。 MoveNext 将 Current 设置为下一个元素。
在传递到集合的末尾之后,枚举数放在集合中最后一个元素后面,且调用 MoveNext 会返回 false。 如果最后一次调用 MoveNext 返回 , false则调用 Current 将引发异常。 若要重置 Current 为集合的第一个元素,请调用 Reset ,然后调用 MoveNext。
只要集合保持不变,枚举器就仍有效。 如果对集合进行了更改(例如添加、修改或删除元素),枚举器将不可恢复地失效,下一次InvalidOperationException调用 MoveNext 或 Reset 引发 。 如果在调用 MoveNext 和 CurrentCurrent 之间修改集合,则返回当前设置它的元素,即使枚举器已失效。
枚举数没有对集合的独占访问权;因此,从头到尾对一个集合进行枚举在本质上不是一个线程安全的过程。 即使某个集合已同步,其他线程仍可以修改该集合,这会导致枚举数引发异常。 若要确保枚举过程中的线程安全性,可以在整个枚举期间锁定集合,或者捕获由其他线程进行的更改所导致的异常。
构造函数
| KeyContainerPermissionAccessEntryEnumerator() | 
				已过时.
			 初始化 KeyContainerPermissionAccessEntryEnumerator 类的新实例。 | 
属性
| Current | 
				已过时.
			 获取集合中的当前项。 | 
方法
| Equals(Object) | 
		已过时.
	 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetHashCode() | 
		已过时.
	 作为默认哈希函数。(继承自 Object) | 
| GetType() | 
		已过时.
	 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 
		已过时.
	 创建当前 Object 的浅表副本。(继承自 Object) | 
| MoveNext() | 
				已过时.
			 移至集合中的下一元素。 | 
| Reset() | 
				已过时.
			 将枚举数重置到集合的开头。 | 
| ToString() | 
		已过时.
	 返回表示当前对象的字符串。(继承自 Object) | 
显式接口实现
| IEnumerator.Current | 
				已过时.
			 获取集合中的当前对象。 |