public FrameCollection(DomContainer ie, IHTMLDocument2 htmlDocument)
        {
            AllFramesProcessor processor = new AllFramesProcessor(ie, (HTMLDocument)htmlDocument);

              NativeMethods.EnumIWebBrowser2Interfaces(processor);

              elements = processor.elements;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Document"/> class.
        /// Mainly used by WatiN internally.
        /// </summary>
        /// <param name="domContainer">The DOM container.</param>
        /// <param name="htmlDocument">The HTML document.</param>
        public Document(DomContainer domContainer, IHTMLDocument2 htmlDocument)
        {
            ArgumentRequired(domContainer, "domContainer");
            ArgumentRequired(htmlDocument, "htmlDocument");

            DomContainer = domContainer;
            this.htmlDocument = htmlDocument;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public RadioButtonCollection(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder, new CreateElementInstance(New))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SelectListCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public SelectListCollection(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder, new CreateElementInstance(New))
 {
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Div"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="htmlDivElement">The HTML div element.</param>
 public Div(DomContainer domContainer, IHTMLDivElement htmlDivElement)
     : base(domContainer, (IHTMLElement)htmlDivElement)
 {
 }
示例#6
0
 /// <summary>
 /// Returns an instance of a SelectList object.
 /// Mainly used internally.
 /// </summary>
 /// <param name="ie">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="finder">The element finder to use.</param>
 public SelectList(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
     //Focus();
 }
示例#7
0
        private void WaitWhileMainDocumentNotAvailable(DomContainer domContainer)
        {
            IHTMLDocument2 document = null;

                while (document == null)
                {
                    try
                    {
                        document = domContainer.HtmlDocument;
                    }
                    catch { }

                    document = IsDocumentAvailable(document, "maindocument");
                }
        }
示例#8
0
 public Span(DomContainer ie, IHTMLSpanElement htmlSpanElement)
     : base(ie, (IHTMLElement) htmlSpanElement)
 {
 }
 public ElementsContainer(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return new RadioButton(domContainer, (IHTMLInputElement)element);
 }
示例#11
0
 public RadioButton(DomContainer ie, IHTMLInputElement inputElement)
     : base(ie, inputElement)
 {
 }
示例#12
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Option(domContainer, (IHTMLOptionElement)element));
 }
示例#13
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Button(domContainer, element));
 }
示例#14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Option"/> class.
 /// </summary>
 /// <param name="ie">The ie.</param>
 /// <param name="finder">The finder.</param>
 public Option(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
示例#15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Option"/> class.
 /// </summary>
 /// <param name="ie">The ie.</param>
 /// <param name="optionElement">The option element.</param>
 public Option(DomContainer ie, IHTMLOptionElement optionElement)
     : base(ie, optionElement)
 {
 }
示例#16
0
 private void init(DomContainer domContainer, object element, ElementFinder elementFinder)
 {
     this.domContainer  = domContainer;
     this.element       = element;
     this.elementFinder = elementFinder;
 }
示例#17
0
 /// <summary>
 /// This constructor is mainly used from within WatiN.
 /// </summary>
 /// <param name="domContainer"><see cref="DomContainer"/> this element is located in</param>
 /// <param name="elementFinder">The element finder.</param>
 public Element(DomContainer domContainer, ElementFinder elementFinder)
 {
     init(domContainer, null, elementFinder);
 }
示例#18
0
 /// <summary>
 /// This constructor is mainly used from within WatiN.
 /// </summary>
 /// <param name="domContainer"><see cref="DomContainer" /> this element is located in</param>
 /// <param name="element">The element</param>
 public Element(DomContainer domContainer, object element)
 {
     init(domContainer, element, null);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 /// <param name="createElementInstance">The create element instance.</param>
 public BaseElementCollection(DomContainer domContainer, ElementFinder finder, CreateElementInstance createElementInstance)
     : this(domContainer, (ArrayList)null, createElementInstance)
 {
     this.finder = finder;
 }
示例#20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DivCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public DivCollection(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder, new CreateElementInstance(New))
 {
 }
示例#21
0
 public RadioCheck(DomContainer ie, IHTMLInputElement inputElement)
     : base(ie, (IHTMLElement) inputElement)
 {
 }
示例#22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DivCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="elements">The elements.</param>
 public DivCollection(DomContainer domContainer, ArrayList elements)
     : base(domContainer, elements, new CreateElementInstance(New))
 {
 }
示例#23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Div"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The HTML div element.</param>
 public Div(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
示例#24
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Div(domContainer, (IHTMLDivElement)element));
 }
示例#25
0
 /// <summary>
 /// Returns an initialized instance of a SelectList object.
 /// Mainly used by the collectionclass SelectLists.
 /// </summary>
 /// <param name="ie">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="htmlSelectElement">The HTML select element.</param>
 public SelectList(DomContainer ie, IHTMLElement htmlSelectElement)
     : base(ie, htmlSelectElement)
 {
     //Focus();
 }
示例#26
0
 /// <summary>
 /// Returns an initialized instance of a SelectList object.
 /// Mainly used by the collectionclass SelectLists.
 /// </summary>
 /// <param name="ie">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="htmlSelectElement">The HTML select element.</param>
 public SelectList(DomContainer ie, IHTMLElement htmlSelectElement) : base(ie, htmlSelectElement)
 {
     //Focus();
 }
示例#27
0
 /// <summary>
 /// This constructor will mainly be used by the constructor of FrameCollection
 /// to create an instance of a Frame.
 /// </summary>
 /// <param name="ie"></param>
 /// <param name="htmlDocument"></param>
 /// <param name="name"></param>
 /// <param name="id"></param>
 public Frame(DomContainer ie, IHTMLDocument2 htmlDocument, string name, string id)
     : base(ie, htmlDocument)
 {
     Init(name, id);
 }
示例#28
0
 /// <summary>
 /// Returns an instance of a SelectList object.
 /// Mainly used internally.
 /// </summary>
 /// <param name="ie">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="finder">The element finder to use.</param>
 public SelectList(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
     //Focus();
 }
示例#29
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return new Span(domContainer, (IHTMLSpanElement)element);
 }
示例#30
0
 public TextField(DomContainer ie, IHTMLElement element) : base(ie, element)
 {
 }
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return new SelectList(domContainer, element);
 }
示例#32
0
 public TextField(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
 }
示例#33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Div"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The HTML div element.</param>
 public Div(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
示例#34
0
        internal static Element GetTypedElement(DomContainer domContainer, IHTMLElement element)
        {
            Assembly assembly = Assembly.Load("ItiN");

            Element returnElement = new ElementsContainer(domContainer, element);

            foreach (Type type in assembly.GetTypes())
            {
                if (type.IsSubclassOf(typeof(Element)))
                {
                    PropertyInfo property = type.GetProperty("ElementTags");
                    if (property != null)
                    {
                        ArrayList elementTags = (ArrayList)property.GetValue(type, null);

                        if (ElementTag.IsValidElement(element, elementTags))
                        {
                            ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(Element) });
                            if (constructor != null)
                            {
                                returnElement = (Element)constructor.Invoke(new object[] { returnElement });
                                break;
                            }
                        }
                    }
                }
            }

            return returnElement;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="elements">The elements.</param>
 public RadioButtonCollection(DomContainer domContainer, ArrayList elements)
     : base(domContainer, elements, new CreateElementInstance(New))
 {
 }
示例#36
0
 private void init(DomContainer domContainer, object element, ElementFinder elementFinder)
 {
     this.domContainer = domContainer;
     this.element = element;
     this.elementFinder = elementFinder;
 }
            /// <exclude />
            public Enumerator(DomContainer domContainer, ArrayList children, CreateElementInstance createElementInstance)
            {
                this.children = children;
                this.domContainer = domContainer;
                this.createElementInstance = createElementInstance;

                Reset();
            }
示例#38
0
 public TextField(DomContainer ie, IHTMLElement element)
     : base(ie, element)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="elements">The elements.</param>
 /// <param name="createElementInstance">The create element instance.</param>
 public BaseElementCollection(DomContainer domContainer, ArrayList elements, CreateElementInstance createElementInstance)
 {
     this.elements = elements;
     this.domContainer = domContainer;
     this.createElementInstance = createElementInstance;
 }
示例#40
0
 public TextField(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
示例#41
0
 public RadioButton(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
示例#42
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return new Div(domContainer, (IHTMLDivElement)element);
 }
示例#43
0
 public RadioCheck(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
 public ElementsContainer(DomContainer ie, object element)
     : base(ie, element)
 {
 }
示例#45
0
 public Span(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
示例#46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Div"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="htmlDivElement">The HTML div element.</param>
 public Div(DomContainer domContainer, IHTMLDivElement htmlDivElement)
     : base(domContainer, (IHTMLElement)htmlDivElement)
 {
 }