/// <summary> /// Create one IHTMLItem element, according to HTML element name passed /// </summary> /// <param name="elementName">name of the element to create</param> /// <param name="standardType"></param> /// <returns>IHTMLItem element</returns> public IHTMLItem CreateHTMLItem(string elementName, HTMLElementType standardType) { if (_elementsMap.ContainsKey(elementName)) { Object theObj = Activator.CreateInstance(_elementsMap[elementName],standardType); var item = theObj as IHTMLItem; return item; } throw new ArgumentException(string.Format("Invalid element name {0} passed",elementName), "elementName"); }
/// <summary> /// Checks if passed standard is valid /// we need this as HTMLElementType is enumeration of [Flags] type and here we need only single value, not bitmask /// </summary> /// <param name="standardType">standard to create element according to</param> /// <returns>if this is valid standard</returns> public static bool CheckIfValidStandardArgument(HTMLElementType standardType) { if (standardType == HTMLElementType.FrameSet || standardType == HTMLElementType.HTML5 || standardType == HTMLElementType.Strict || standardType == HTMLElementType.Transitional || standardType == HTMLElementType.XHTML11 || standardType == HTMLElementType.XHTML5 ) { return true; } return false; }
private XDocumentType GetDocumentType(HTMLElementType documentStandard) { switch (documentStandard) { case HTMLElementType.FrameSet: return new XDocumentType("html", @"-//W3C//DTD XHTML 1.0 Frameset//EN", @"DTD/xhtml1-frameset.dtd", null); case HTMLElementType.Strict: return new XDocumentType("html", @"-//W3C//DTD XHTML 1.0 Strict//EN", @"DTD/xhtml1-strict.dtd", null); case HTMLElementType.Transitional: return new XDocumentType("html", @"-//W3C//DTD XHTML 1.0 Transitional//EN", @"DTD/xhtml1-transitional.dtd", null); case HTMLElementType.XHTML11: case HTMLElementType.XHTML5: return new XDocumentType("html", @"-//W3C//DTD XHTML 1.1//EN", @"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd", null); case HTMLElementType.HTML5: return new XDocumentType("html", null, null, null); } throw new NotImplementedException(string.Format("The case of {0} not implemented yet", documentStandard)); }
protected HTMLItem(HTMLElementType htmlStandard) { _htmlStandard = htmlStandard; RegisterAttributes(); }
public HTMLDocument(HTMLElementType standard) { _documentStandard = standard; _htmlRoot = new HTML(standard); }
public CodeText(HTMLElementType htmlStandard) : base(htmlStandard) { }
public ListItem(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Applet(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Input(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Frameset(HTMLElementType htmlStandard) : base(htmlStandard) { }
public TextArea(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Teletext(HTMLElementType htmlStandard) : base(htmlStandard) { }
public BiDirectionalOverride(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Definition(HTMLElementType htmlStandard) : base(htmlStandard) { }
public TableHeaderCell(HTMLElementType htmlStandard) : base(htmlStandard) { }
public ShortQuote(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Area(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Track(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Summary(HTMLElementType htmlStandard) : base(htmlStandard) { }
public SimpleHTML5Text(HTMLElementType htmlStandard) : base(htmlStandard) { }
public TableFooter(HTMLElementType htmlStandard) : base(htmlStandard) { }
public DefinitionList(HTMLElementType htmlStandard) : base(htmlStandard) { }
protected TextBasedElement(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Canvas(HTMLElementType htmlStandard) : base(htmlStandard) { }
public EmptyLine(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Anchor(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Underlined(HTMLElementType htmlStandard) : base(htmlStandard) { }
public InlineFrame(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Abbreviation(HTMLElementType htmlStandard) : base(htmlStandard) { }
public BoldText(HTMLElementType htmlStandard) : base(htmlStandard) { }
public MenuItem(HTMLElementType htmlStandard) : base(htmlStandard) { }
public BlockQuoteElement(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Select(HTMLElementType htmlStandard) : base(htmlStandard) { }
public HorizontalRuler(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Style(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Address(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Label(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Title(HTMLElementType htmlStandard) : base(htmlStandard) { TextContent = new SimpleHTML5Text(htmlStandard); }
public InsertedText(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Acronym(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Map(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Source(HTMLElementType htmlStandard) : base(htmlStandard) { }
public DirectoryList(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Dialog(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Paragraph(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Form(HTMLElementType htmlStandard) : base(htmlStandard) { }
public TableHead(HTMLElementType htmlStandard) : base(htmlStandard) { }
public EmphasisedText(HTMLElementType htmlStandard) : base(htmlStandard) { }
public OptionGroup(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Progress(HTMLElementType htmlStandard) : base(htmlStandard) { }
public TableCaption(HTMLElementType htmlStandard) : base(htmlStandard) { }
public ObjectElm(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Center(HTMLElementType htmlStandard) : base(htmlStandard) { }
public Base(HTMLElementType htmlStandard) : base(htmlStandard) { }