- cominteropwithdotnetsource.zip
- COMInteropWithDOTNET
- COMInteropWithDOTNETSource
- ClassicCOM
- AirlineInformation
- AirlineNotify
- IceCreamParlor
- MyFlyer
- NETThreadDemoClient
- VBAirlineControlTower
- VBIceCreamParlor
- IceCreamMenu.cls
- stdole.dll
- VBIceCreamProject.exp
- VBIceCreamProject.lib
- VBIceCreamProject.vbp
- VBIceCreamProject.vbw
- VBTestClient
- VBWeatherStation
- DOTNET-CSharpFiles
- cominteropwithdotnetdemo.zip
- COMInteropWithDOTNETDemo
- AirlineClient.exe
- AirlineInformation.dll
- AirlineMetadata.dll
- AirlineNotify.exe
- AirlineNotifyClient.exe
- AirlineNotifyMetadata.dll
- ControlTower.exe
- DelegateTest.exe
- Directional.dll
- FlightClient.exe
- HelloDotNet.dll
- HelloWorldDelegate.exe
- IceCreamMenuClient.exe
- IceCreamMenuMetadata.dll
- IceCreamParlor.dll
- MyFlyer.dll
- MyFlyerMetadata.dll
- NETThreadDemoClient.exe
- RegisterAll.bat
- SevenDwarfs.exe
- Temperature.dll
- VBIceCreamProject.dll
- VBTestClient.exe
- VBWeatherStation.exe
- WeatherNotify.dll
- cominterop_demo.zip
- ComInteropDemo
- AirlineCSharpClient
- AirlineInformation
|
using System;
using System.Collections;
public class SevenDwarfs : IEnumerable , IEnumerator
{
private int nCurrentPos = -1;
private string[] strArrayDwarfs = new String[7] {"Doc", "Dopey", "Happy", "Grumpy",
"Sleepy", "Sneezy" , "Bashful"};
SevenDwarfs() {}
// Method : IEnumerable.GetEnumerator
// Return an appropriate Enumerator for the collection
public IEnumerator GetEnumerator()
{
return (IEnumerator)this;
}
// Method : IEnumerator.MoveNext
// Move the enumerator to the next element in the collection
// and return boolean status whether we still have elements to
// enumerate
public bool MoveNext()
{
if(nCurrentPos < strArrayDwarfs.Length - 1)
{
nCurrentPos++;
return true;
}
else
{
return false;
}
}
// Method : IEnumerator.Reset
// Reset the enumerator to the beginning of the collection
public void Reset()
{
nCurrentPos = -1;
}
// Method : IEnumerator.Current
// Return the element at the current enumerator position
public object Current
{
get
{
return strArrayDwarfs[nCurrentPos];
}
}
public static void Main(String[] args)
{
// Create an instance of the SevenDwarfs object
SevenDwarfs SnowWhitesDwarfs = new SevenDwarfs();
// Enumerate through the Collection
foreach(string dwarf in SnowWhitesDwarfs)
{
System.Console.WriteLine("{0}",dwarf);
}
}/* end Main */
}/* end class SevenDwarfs */
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.