//Visual Basic 2010 Shadowing - Shadows Static Typing en Dynamic Binding namespace FragileBaseClass2 { public class CharString { private char[] m_Items; public virtual void Add(char aChar) { this.m_Items((this.m_Items.Length - 1)) = aChar; } public virtual void AddAll(char[] chars) { int oldUpperBound; int newUpperBound; if ((this.m_Items != null)) { oldUpperBound = (this.m_Items.Length - 1); } if ((chars != null)) { newUpperBound = (oldUpperBound + chars.Length); } int index = (oldUpperBound + 1); for (System.Collections.IEnumerator _it1 = chars.GetEnumerator(); _it1.MoveNext(); ) { char charElement = ((char)(_it1.Current)); this.m_Items(index) = charElement; this.index += new System.EventHandler(1); } } public override void ToString() { if ((this.m_Items != null)) { for (System.Collections.IEnumerator _it1 = this.m_Items.GetEnumerator(); _it1.MoveNext(); ) { char charElement = ((char)(_it1.Current)); ToString = charElement; } } } } public class CountedCharString : CharString { private int m_Count; public virtual int Count { get { Count = this.m_Count; } } public override void Add(char aChar) { base.Add(aChar); this.m_Count += new System.EventHandler(1); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.