Ienumerable public enumerator

Source: Internet
Author: User

// Summary:

// Public enumerator, which supports simple iteration on a non-generic set.

[Comvisible (true)]

[GUID ("496b0abe-cdee-11d3-88e8-00902754c43a")]

Public interface ienumerable

{

// Summary:

// Returns an enumerator for the cyclic access set.

//

// Return result:

// The system. Collections. ienumerator object that can be used to access the set cyclically.

[Dispid (-4)]

Ienumerator getenumerator ();

}


Method:


Method Method Name Description
Getenumerator Getenumerator Get an iterator for the loop access set
Asparallel Asparallel Enable query parallelization. (Defined by parallelenumerable .) (Extension Method)
Asqueryable Asqueryable Convert ienumerable to iqueryable. (Defined by queryable .)
Cast <tresult> Cast <tresult> Forcibly convert the ienumerable element to the specified type. (Defined by enumerable .)
Oftype <tresult> Oftype <tresult> Filters ienumerable elements based on the specified type. (Defined by enumerable .)


Note:

Ienumerable is an enumeration interface for any non-generic set. For the generic version of this interface, see system. Collections. Generic. ienumerable <t>. Ienumerable contains a method, getenumerator, which returns ienumerator. Ienumerator can display the current attributes and movenext and reset Methods cyclically through a set.

It is an optimal method for implementing ienumerable and ienumerator to enable the foreach (for each in Visual Basic) syntax in the Set option class. However, ienumerable does not need to be implemented. If you do not implement ienumerable in the collection, you must also follow the iterator form to support this syntax by providing the return interface, option class, or structure's getenumerator method. When using Visual Basic, you must provide ienumerator implementation, which is returned by getenumerator. When C # is required for development, an option class with the current attribute and the terminator ienumerator described by movenext and reset methods are included. However, the option class does not need to implement ienumerator.


Example program: see the ienumerator enumeration number interface Example

Http://4837471.blog.51cto.com/4827471/1561773



This article is from the coffee blog, please be sure to keep this source http://4837471.blog.51cto.com/4827471/1561816

Ienumerable public enumerator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.