internal ChildEnumerator(DirectoryEntry container) { this.container = container; if (container.IsContainer) { this.enumVariant = new SafeNativeMethods.EnumVariant((SafeNativeMethods.IEnumVariant)container.ContainerObject._NewEnum); } }
/// <include file='doc\DirectoryEntries.uex' path='docs/doc[@for="DirectoryEntries.ChildEnumerator.Reset"]/*' /> /// <devdoc> /// <para>Resets the enumerator back to its initial position before the first element in the collection.</para> /// </devdoc> public void Reset() { if (enumVariant != null) { try { enumVariant.Reset(); } catch (NotImplementedException) { //Some providers might not implement Reset, workaround the problem. enumVariant = new SafeNativeMethods.EnumVariant((SafeNativeMethods.IEnumVariant)container.ContainerObject._NewEnum); } currentEntry = null; } }
public void Reset() { if (this.enumVariant != null) { try { this.enumVariant.Reset(); } catch (NotImplementedException) { this.enumVariant = new SafeNativeMethods.EnumVariant((SafeNativeMethods.IEnumVariant) this.container.ContainerObject._NewEnum); } this.currentEntry = null; } }