Exemplo n.º 1
0
        public FrameCollection(DomContainer ie, IHTMLDocument2 htmlDocument)
        {
            AllFramesProcessor processor = new AllFramesProcessor(ie, (HTMLDocument)htmlDocument);

              NativeMethods.EnumIWebBrowser2Interfaces(processor);

              elements = processor.elements;
        }
Exemplo n.º 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))
 {
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 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();
 }
Exemplo n.º 7
0
        private void WaitWhileMainDocumentNotAvailable(DomContainer domContainer)
        {
            IHTMLDocument2 document = null;

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

                    document = IsDocumentAvailable(document, "maindocument");
                }
        }
Exemplo n.º 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);
 }
Exemplo n.º 11
0
 public RadioButton(DomContainer ie, IHTMLInputElement inputElement)
     : base(ie, inputElement)
 {
 }
Exemplo n.º 12
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Option(domContainer, (IHTMLOptionElement)element));
 }
Exemplo n.º 13
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Button(domContainer, element));
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 16
0
 private void init(DomContainer domContainer, object element, ElementFinder elementFinder)
 {
     this.domContainer  = domContainer;
     this.element       = element;
     this.elementFinder = elementFinder;
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
 }
Exemplo n.º 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))
 {
 }
Exemplo n.º 21
0
 public RadioCheck(DomContainer ie, IHTMLInputElement inputElement)
     : base(ie, (IHTMLElement) inputElement)
 {
 }
Exemplo n.º 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))
 {
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 24
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Div(domContainer, (IHTMLDivElement)element));
 }
Exemplo n.º 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();
 }
Exemplo n.º 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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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();
 }
Exemplo n.º 29
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return new Span(domContainer, (IHTMLSpanElement)element);
 }
Exemplo n.º 30
0
 public TextField(DomContainer ie, IHTMLElement element) : base(ie, element)
 {
 }
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return new SelectList(domContainer, element);
 }
Exemplo n.º 32
0
 public TextField(DomContainer ie, ElementFinder finder) : base(ie, finder)
 {
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 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))
 {
 }
Exemplo n.º 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();
            }
Exemplo n.º 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;
 }
Exemplo n.º 40
0
 public TextField(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemplo n.º 41
0
 public RadioButton(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemplo n.º 42
0
 private static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return new Div(domContainer, (IHTMLDivElement)element);
 }
Exemplo n.º 43
0
 public RadioCheck(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemplo n.º 44
0
 public ElementsContainer(DomContainer ie, object element)
     : base(ie, element)
 {
 }
Exemplo n.º 45
0
 public Span(DomContainer ie, ElementFinder finder)
     : base(ie, finder)
 {
 }
Exemplo n.º 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)
 {
 }