コード例 #1
0
        public static CssSelectorConstraint FindByCss(DomContainer domContainer, string cssSelector)
        {
            string cssMarker = "findByCssMarker" + ++_cssMarkerIndex;

            var constraint = new CssSelectorConstraint(new ScriptLoader(), domContainer);
            constraint.Initialize(cssSelector, cssMarker);
            return constraint;
        }
コード例 #2
0
	    public static Element GetDefaultReturnElement(DomContainer domContainer, INativeElement ieNativeElement)
	    {
#if NET11
			return new ElementsContainer(domContainer, ieNativeElement);
#else
	        return new ElementsContainer<Element>(domContainer, ieNativeElement);
#endif
	    }
コード例 #3
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static Element Element(DomContainer domContainer, BaseConstraint findBy, IElementCollection elements)
		{
#if NET11
			return new ElementsContainer(domContainer, domContainer.NativeBrowser.CreateElementFinder(null, findBy, elements));
#else
            return new ElementsContainer<Element>(domContainer, domContainer.NativeBrowser.CreateElementFinder(null, findBy, elements));
#endif
        }
コード例 #4
0
ファイル: FrameCollection.cs プロジェクト: pusp/o2platform
		public FrameCollection(DomContainer domContainer, IHTMLDocument2 htmlDocument)
		{
			AllFramesProcessor processor = new AllFramesProcessor(domContainer, (HTMLDocument) htmlDocument);

			NativeMethods.EnumIWebBrowser2Interfaces(processor);

			elements = processor.elements;
		}
コード例 #5
0
ファイル: Document.cs プロジェクト: pusp/o2platform
		/// <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;
		}
コード例 #6
0
ファイル: Frame.cs プロジェクト: fschwiet/watin_unbranched
        /// <summary>
        /// This constructor will mainly be used by the constructor of FrameCollection
        /// to create an instance of a Frame.
        /// </summary>
        /// <param name="domContainer">The domContainer</param>
        /// <param name="frameDocument">The document within the frame</param>
        public Frame(DomContainer domContainer, INativeDocument frameDocument)
            : base(domContainer)
        {
            if (frameDocument == null)
                throw new ArgumentNullException("frameDocument");

            _frameDocument = frameDocument;
            _frameElement = new Element(domContainer, frameDocument.ContainingFrameElement);
        }
コード例 #7
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static Element Element(DomContainer domContainer, string tagname, BaseConstraint findBy, IElementCollection elements, params string[] inputtypes)
		{
			string inputtypesString = UtilityClass.StringArrayToString(inputtypes, ",");

#if NET11
			return new ElementsContainer(domContainer, domContainer.NativeBrowser.CreateElementFinder(tagname, inputtypesString, findBy, elements));
#else
            return new ElementsContainer<Element>(domContainer, domContainer.NativeBrowser.CreateElementFinder(tagname, inputtypesString, findBy, elements));
#endif
		}
コード例 #8
0
ファイル: Frame.cs プロジェクト: exaphaser/WatiN
	    /// <summary>
	    /// This constructor will mainly be used by the constructor of FrameCollection
	    /// to create an instance of a Frame.
	    /// </summary>
	    /// <param name="domContainer">The domContainer</param>
	    /// <param name="frameDocument">The document within the frame</param>
	    /// <param name="parentDocument"> </param>
	    public Frame(DomContainer domContainer, INativeDocument frameDocument, Frame parentDocument)
            : base(domContainer)
		{
	        if (frameDocument == null)
                throw new ArgumentNullException("frameDocument");

            _frameDocument = frameDocument;
            FrameElement = CreateFrameElement(domContainer, frameDocument);

            SetFrameHierarchy(parentDocument, frameDocument);
		}
コード例 #9
0
        /// <summary>
        /// Creates an element finder.
        /// </summary>
        /// <param name="domContainer">The DOM container</param>
        /// <param name="factory">The factory to get the element(s) to search in</param>
        /// <param name="elementTags">The element tags considered by the finder, or null if all tags considered</param>
        /// <param name="constraint">The constraint used by the finder to filter elements, or null if no additional constraint</param>
        public NativeElementFinder(NativeElementCollectionFactory factory, DomContainer domContainer, IList<ElementTag> elementTags, Constraint constraint)
            : base(elementTags, constraint)
        {
            if (factory == null)
                throw new ArgumentNullException("factory");
            if (domContainer == null)
                throw new ArgumentNullException("domContainer");

            this.factory = factory;
            this.domContainer = domContainer;
        }
コード例 #10
0
ファイル: AllFramesProcessor.cs プロジェクト: pusp/o2platform
		public AllFramesProcessor(DomContainer domContainer, HTMLDocument htmlDocument)
		{
			elements = new ArrayList();

			frameElements = (IHTMLElementCollection) htmlDocument.all.tags(ElementsSupport.FrameTagName);

			// If the current document doesn't contain FRAME elements, it then
			// might contain IFRAME elements.
			if (frameElements.length == 0)
			{
				frameElements = (IHTMLElementCollection) htmlDocument.all.tags("IFRAME");
			}

			this._domContainer = domContainer;
			this.htmlDocument = htmlDocument;
		}
コード例 #11
0
		public static Element CreateTypedElement(DomContainer domContainer, INativeElement ieNativeElement)
		{
			if (ieNativeElement == null) return null;

			if (_elementConstructors == null)
			{
				_elementConstructors = CreateElementConstructorHashTable();
			}

			ElementTag elementTag = new ElementTag(ieNativeElement);
            Element returnElement = GetDefaultReturnElement(domContainer, ieNativeElement);

		    if (_elementConstructors.Contains(elementTag))
			{
				ConstructorInfo constructorInfo = (ConstructorInfo)_elementConstructors[elementTag];
				return (Element)constructorInfo.Invoke(new object[] { returnElement });
			}

			return returnElement;
		}
コード例 #12
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static TextField TextField(DomContainer domContainer, BaseConstraint findBy, IElementCollection elements)
		{
			return new TextField(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.TextField.ElementTags, findBy, elements));
		}
コード例 #13
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static SpanCollection Spans(DomContainer domContainer, IElementCollection elements)
		{
			return new SpanCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.Span.ElementTags, elements));
		}
コード例 #14
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static SelectList SelectList(DomContainer domContainer, BaseConstraint findBy, IElementCollection elements)
		{
			return new SelectList(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.SelectList.ElementTags, findBy, elements));
		}
コード例 #15
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static TableBody TableBody(DomContainer domContainer, BaseConstraint findBy, IElementCollection elements)
		{
			return new TableBody(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.TableBody.ElementTags, findBy, elements));
		}
コード例 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ListItem"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="nativeElement">The HTML li element.</param>
 public ListItem(DomContainer domContainer, INativeElement nativeElement)
     : base(domContainer, nativeElement)
 {
 }
コード例 #17
0
 internal new static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Form(domContainer, (IHTMLFormElement)element));
 }
コード例 #18
0
 public Label(DomContainer domContainer, INativeElement labelElement) : base(domContainer, labelElement)
 {
 }
コード例 #19
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static CheckBox CheckBox(DomContainer domContainer, BaseConstraint findBy, IElementCollection elements)
		{
			return new CheckBox(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.CheckBox.ElementTags, findBy, elements));
		}
コード例 #20
0
 public Para(DomContainer domContainer, INativeElement htmlParaElement) : base(domContainer, htmlParaElement)
 {
 }
コード例 #21
0
 public static Element CreateFrameElement(DomContainer domContainer, INativeDocument frameDocument)
 {
     return(new Element(domContainer, frameDocument.ContainingFrameElement));
 }
コード例 #22
0
 public TextField(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #23
0
 public TextField(DomContainer domContainer, INativeElement element) : base(domContainer, element)
 {
 }
コード例 #24
0
 public Form(DomContainer domContainer, IHTMLFormElement htmlFormElement) :
     base(domContainer, domContainer.NativeBrowser.CreateElement(htmlFormElement))
 {
 }
コード例 #25
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static ImageCollection Images(DomContainer domContainer, IElementCollection elements)
		{
			return new ImageCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.Image.ElementTags, elements));
		}
コード例 #26
0
 public Label(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #27
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static AreaCollection Areas(DomContainer domContainer, IElementCollection elements)
		{
			return new AreaCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.Area.ElementTags, elements));
		}
コード例 #28
0
 /// <summary>
 /// Returns an initialized instance of a SelectList object.
 /// Mainly used by the collectionclass SelectLists.
 /// </summary>
 /// <param name="domContainer">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="element">The HTML select element.</param>
 public SelectList(DomContainer domContainer, IHTMLElement element) :
     base(domContainer, domContainer.NativeBrowser.CreateElement(element))
 {
 }
コード例 #29
0
 public TableBody(DomContainer domContainer, INativeElement element) : base(domContainer, element)
 {
 }
コード例 #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParaCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The finder.</param>
 public ParaCollection(DomContainer domContainer, INativeElementFinder finder) : base(domContainer, finder, new CreateElementInstance(Para.New))
 {
 }
コード例 #31
0
 internal new static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new SelectList(domContainer, element));
 }
コード例 #32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParaCollection"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="elements">The elements.</param>
 public ParaCollection(DomContainer domContainer, ArrayList elements) : base(domContainer, elements, new CreateElementInstance(Para.New))
 {
 }
コード例 #33
0
 public RadioCheck(DomContainer domContainer, INativeElement element) : base(domContainer, element)
 {
 }
コード例 #34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ListItem"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The DOM container.</param>
 /// <param name="finder">The HTML li element.</param>
 public ListItem(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
コード例 #35
0
 public Element(DomContainer domContainer, ElementFinder elementFinder)
     : base(domContainer, elementFinder)
 {
 }
コード例 #36
0
 public RadioCheck(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #37
0
 public Element(DomContainer domContainer, INativeElement nativeElement) : base(domContainer, nativeElement)
 {
 }
コード例 #38
0
ファイル: Form.cs プロジェクト: xrcdev/FluentSharp_Fork.WatiN
 public Form(DomContainer domContainer, INativeElement htmlFormElement) : base(domContainer, htmlFormElement)
 {
 }
コード例 #39
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static TableCell TableCell(DomContainer domContainer, Regex elementId, int index, IElementCollection elements)
		{
			return new TableCell(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.TableCell.ElementTags, Find.ByIndex(index).And(Find.ById(elementId)), elements));
		}
コード例 #40
0
ファイル: Form.cs プロジェクト: xrcdev/FluentSharp_Fork.WatiN
 public Form(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #41
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static TableBodyCollection TableBodies(DomContainer domContainer, IElementCollection elements)
		{
			return new TableBodyCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.TableBody.ElementTags, elements));
		}
コード例 #42
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, domContainer.NativeBrowser.CreateElement(htmlDivElement))
 {
 }
コード例 #43
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static TextFieldCollection TextFields(DomContainer domContainer, IElementCollection elements)
		{
			return new TextFieldCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.TextField.ElementTags, elements));
		}
コード例 #44
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, INativeElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #45
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static DivCollection Divs(DomContainer domContainer, IElementCollection elements)
		{
			return new DivCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.Div.ElementTags, elements));
		}
コード例 #46
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static ElementCollection Elements(DomContainer domContainer, IElementCollection elements)
		{
			return new ElementCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(null, elements));
		}
コード例 #47
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static Area Area(DomContainer domContainer, BaseConstraint findBy, IElementCollection elements)
		{
			return new Area(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.Area.ElementTags, findBy, elements));
		}
コード例 #48
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static FileUploadCollection FileUploads(DomContainer domContainer, IElementCollection elements)
		{
			return new FileUploadCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.FileUpload.ElementTags, elements));
		}
コード例 #49
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static ButtonCollection Buttons(DomContainer domContainer, IElementCollection elements)
		{
			return new ButtonCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.Button.ElementTags, elements));
		}
コード例 #50
0
 public TextFieldExtended(DomContainer domContainer, INativeElement element)
     : base(domContainer, element)
 {
 }
コード例 #51
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static CheckBoxCollection CheckBoxes(DomContainer domContainer, IElementCollection elements)
		{
			return new CheckBoxCollection(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.CheckBox.ElementTags, elements));
		}
コード例 #52
0
 public TableBody(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #53
0
 internal new static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new Div(domContainer, (IHTMLDivElement)element));
 }
コード例 #54
0
 /// <summary>
 /// Returns an instance of a SelectList object.
 /// Mainly used internally.
 /// </summary>
 /// <param name="domContainer">The <see cref="DomContainer"/> the element is in.</param>
 /// <param name="finder">The element finder to use.</param>
 public SelectList(DomContainer domContainer, INativeElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #55
0
ファイル: ElementsSupport.cs プロジェクト: pusp/o2platform
		public static FileUpload FileUpload(DomContainer domContainer, BaseConstraint findBy, IElementCollection elements)
		{
			return new FileUpload(domContainer, domContainer.NativeBrowser.CreateElementFinder(Core.FileUpload.ElementTags, findBy, elements));
		}
コード例 #56
0
 /// <summary>
 /// Initialises a new instance of the <see cref="Button"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The <see cref="DomContainer" /> the element is in.</param>
 /// <param name="element">The input button or button element.</param>
 public Button(DomContainer domContainer, INativeElement element) : base(domContainer, element)
 {
 }
コード例 #57
0
 /// <summary>
 /// Initialises a new instance of the <see cref="Button"/> class.
 /// Mainly used by WatiN internally.
 /// </summary>
 /// <param name="domContainer">The <see cref="DomContainer" /> the element is in.</param>
 /// <param name="finder">The input button or button element.</param>
 public Button(DomContainer domContainer, ElementFinder finder) : base(domContainer, finder)
 {
 }
コード例 #58
0
 public StaticElementFinder(DomContainer domcontainer, INativeElement nativeElement) : base(CreateTagList(nativeElement), Find.First())
 {
     _domContainer  = domcontainer;
     _nativeElement = nativeElement;
 }
コード例 #59
0
 public TextFieldExtended(DomContainer domContainer, ElementFinder finder)
     : base(domContainer, finder)
 {
 }
コード例 #60
0
 internal new static Element New(DomContainer domContainer, IHTMLElement element)
 {
     return(new RadioButton(domContainer, (IHTMLInputElement)element));
 }