public void GetEnumeratorEx() { //ExStart //ExFor:WarningInfoCollection.GetEnumerator //ExFor:WarningInfoCollection.Clear //ExSummary:Shows how to read and clear a collection of warnings. WarningInfoCollection wic = new WarningInfoCollection(); var enumerator = wic.GetEnumerator(); while (enumerator.MoveNext()) { WarningInfo wi = (WarningInfo)enumerator.Current; Console.WriteLine(wi.Description); } wic.Clear(); //ExEnd }
public void GetEnumeratorEx() { //ExStart //ExFor:WarningInfoCollection.GetEnumerator //ExFor:WarningInfoCollection.Clear //ExSummary:Shows how to read and clear a collection of warnings. WarningInfoCollection wic = new WarningInfoCollection(); using (IEnumerator <WarningInfo> enumerator = wic.GetEnumerator()) { while (enumerator.MoveNext()) { WarningInfo wi = enumerator.Current; if (wi != null) { Console.WriteLine(wi.Description); } } wic.Clear(); } //ExEnd }