public HtmlWindow this[int index] { get { if (index < 0 || index >= Count) { throw new ArgumentOutOfRangeException(nameof(index), index, string.Format(SR.InvalidBoundArgument, nameof(index), index, 0, Count - 1)); } object oIndex = (object)index; return((NativeHTMLFramesCollection2.Item(ref oIndex) is UnsafeNativeMethods.IHTMLWindow2 htmlWindow2) ? new HtmlWindow(shimManager, htmlWindow2) : null); } }
public HtmlWindow this[string windowId] { get { object oWindowId = (object)windowId; UnsafeNativeMethods.IHTMLWindow2 htmlWindow2 = null; try { htmlWindow2 = htmlFramesCollection2.Item(ref oWindowId) as UnsafeNativeMethods.IHTMLWindow2; } catch (COMException) { throw new ArgumentException(string.Format(SR.InvalidArgument, nameof(windowId), windowId), nameof(windowId)); } return((htmlWindow2 != null) ? new HtmlWindow(shimManager, htmlWindow2) : null); } }