//Visual Basic 2010 Collecties - Inleiding Object Oriented Programming namespace Alternative1 { public class Sentence { private int m_Count; private int m_Capacity = 16; private string[] m_Words = new string[0]; public virtual int Count { get { Count = this.m_Count; } } public virtual string this[int index] { get { Item = this.m_Words(index); } } public virtual void Add(string word) { this.m_Count += new System.EventHandler(1); if ((Count > this.m_Capacity)) { this.m_Capacity = 2; } this.m_Words((Count - 1)) = word; } public virtual void IndexOf(string word) { IndexOf = -1; if ((Count > 0)) { bool found; for (bool _do1 = true; _do1; _do1 = (found || (IndexOf == (Count - 1)))) { this.IndexOf += new System.EventHandler(1); found = (this.Item(IndexOf) == word); } if ((found == false)) { IndexOf = -1; } } } public virtual void Contains(string word) { Contains = (this.IndexOf(word) != -1); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.