/// <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");
 }
示例#2
0
 /// <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;
 }
示例#3
0
        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));
        }
示例#4
0
 protected HTMLItem(HTMLElementType htmlStandard)
 {
     _htmlStandard = htmlStandard;
     RegisterAttributes();
 }
示例#5
0
 public HTMLDocument(HTMLElementType standard)
 {
     _documentStandard = standard;
     _htmlRoot = new HTML(standard);
 }
示例#6
0
 public CodeText(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#7
0
 public ListItem(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#8
0
 public Applet(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#9
0
文件: Input.cs 项目: npuBug/fb2epub
 public Input(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#10
0
 public Frameset(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#11
0
 public TextArea(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#12
0
 public Teletext(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
 public BiDirectionalOverride(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#14
0
 public Definition(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#15
0
 public TableHeaderCell(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#16
0
 public ShortQuote(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#17
0
 public Area(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#18
0
 public Track(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#19
0
 public Frameset(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#20
0
 public Summary(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#21
0
 public SimpleHTML5Text(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#22
0
 public TableFooter(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#23
0
 public DefinitionList(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#24
0
 protected TextBasedElement(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#25
0
文件: Canvas.cs 项目: npuBug/fb2epub
 public Canvas(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#26
0
 public EmptyLine(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#27
0
 public Anchor(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#28
0
 public Underlined(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#29
0
 public Track(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#30
0
 public InlineFrame(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#31
0
 public Abbreviation(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#32
0
 public BiDirectionalOverride(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#33
0
 public BoldText(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#34
0
 public MenuItem(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
 public BlockQuoteElement(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#36
0
 public Select(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#37
0
 public HorizontalRuler(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#38
0
 public Style(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#39
0
 public Address(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#40
0
 public Label(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#41
0
文件: Title.cs 项目: npuBug/fb2epub
 public Title(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
     TextContent = new SimpleHTML5Text(htmlStandard);
 }
示例#42
0
 public InsertedText(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#43
0
 public Acronym(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#44
0
 public Map(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#45
0
 public Abbreviation(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#46
0
 public Source(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#47
0
 public DirectoryList(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#48
0
 public Dialog(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#49
0
 public Paragraph(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#50
0
 public Form(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#51
0
 public TableHead(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#52
0
 public EmphasisedText(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#53
0
 public OptionGroup(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#54
0
 public Progress(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#55
0
 public TableCaption(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#56
0
 public ObjectElm(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#57
0
 public Center(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#58
0
 public ListItem(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }
示例#59
0
 public Base(HTMLElementType htmlStandard)
     : base(htmlStandard)
 {
 }
示例#60
0
 public OptionGroup(HTMLElementType htmlStandard) : base(htmlStandard)
 {
 }