Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Collection Classes Sample

This sample shows how to implement a collection class that can be used with the foreach statement.

This sample contains the source code for the Collection Classes Tutorial.

Building and Running the Sample Within Visual Studio

To build and run the Collection Classes samples

  1. Open the solution (CollectionClasses.sln).
  2. In Solution Explorer, right-click the CollectionClasses1 project and click Set as StartUp Project.
  3. From the Debug menu, click Start Without Debugging.
  4. Repeat the preceding steps for CollectionClasses2.

Building and Running the Sample from the Command Line

To build and run the Collection Classes samples

  1. Use the Change Directory command to change to the CollectionClasses1 directory.
  2. Type the following:
    csc tokens.cs
    tokens
    
  3. Use the Change Directory command to change to the CollectionClasses2 directory.
  4. Type the following:
    csc tokens2.cs
    tokens2
    

See Also

Collection Classes Tutorial | Tutorial Samples

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft