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 IHTMLWindow2 htmlWindow2) ? new HtmlWindow(shimManager, htmlWindow2) : null);
            }
        }
Beispiel #2
0
 public HtmlWindow this[string windowId]
 {
     get
     {
         object       oWindowId   = (object)windowId;
         IHTMLWindow2 htmlWindow2 = null;
         try
         {
             htmlWindow2 = htmlFramesCollection2.Item(ref oWindowId)
                           as IHTMLWindow2;
         }
         catch (COMException)
         {
             throw new ArgumentException(string.Format(SR.InvalidArgument, nameof(windowId), windowId), nameof(windowId));
         }
         return((htmlWindow2 != null) ? new HtmlWindow(shimManager, htmlWindow2) : null);
     }
 }