當前位置: 首頁>>代碼示例>>C#>>正文


C# TidyNet.Node類代碼示例

本文整理匯總了C#中TidyNet.Node的典型用法代碼示例。如果您正苦於以下問題:C# Node類的具體用法?C# Node怎麽用?C# Node使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Node類屬於TidyNet命名空間,在下文中一共展示了Node類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            AttVal attval;
            Attribute attribute;
            bool hasAlt = false;
            bool hasHref = false;

            node.CheckUniqueAttributes(lexer);

            for (attval = node.Attributes; attval != null; attval = attval.Next)
            {
                attribute = attval.CheckAttribute(lexer, node);

                if (attribute == AttributeTable.AttrAlt)
                {
                    hasAlt = true;
                }
                else if (attribute == AttributeTable.AttrHref)
                {
                    hasHref = true;
                }
            }

            if (!hasAlt)
            {
                lexer.badAccess |= Report.MISSING_LINK_ALT;
                Report.AttrError(lexer, node, "alt", Report.MISSING_ATTRIBUTE);
            }
            if (!hasHref)
            {
                Report.AttrError(lexer, node, "href", Report.MISSING_ATTRIBUTE);
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:33,代碼來源:AreaCheckTableCheckAttribs.cs

示例2: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            node.CheckUniqueAttributes(lexer);

            AttVal lang = node.GetAttrByName("language");
            AttVal type = node.GetAttrByName("type");
            if (type == null)
            {
                Report.AttrError(lexer, node, "type", Report.MISSING_ATTRIBUTE);

                /* check for javascript */
                if (lang != null)
                {
                    string str = lang.Val;
                    if (str.Length > 10)
                    {
                        str = str.Substring(0, 10);
                    }

                    if ((String.Compare(str, "javascript") == 0) || (String.Compare(str, "jscript") == 0))
                    {
                        node.AddAttribute("type", "text/javascript");
                    }
                }
                else
                {
                    node.AddAttribute("type", "text/javascript");
                }
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:30,代碼來源:ScriptCheckAttribs.cs

示例3: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            AttVal attval;
            string val = null;

            node.CheckUniqueAttributes(lexer);

            for (attval = node.Attributes; attval != null; attval = attval.Next)
            {
                if (String.Compare(attval.Attribute, "align") == 0)
                {
                    val = attval.Val;
                    break;
                }
            }

            if (val != null)
            {
                if (String.Compare(val, "left") == 0 || String.Compare(val, "right") == 0)
                {
                    lexer.versions &= HtmlVersion.Html40Loose | HtmlVersion.Frames;
                }
                else if (String.Compare(val, "top") == 0 || String.Compare(val, "bottom") == 0)
                {
                    lexer.versions &= HtmlVersion.From32;
                }
                else
                {
                    Report.AttrError(lexer, node, val, Report.BAD_ATTRIBUTE_VALUE);
                }
            }
        }
開發者ID:AlfieJ,項目名稱:TidyNet,代碼行數:32,代碼來源:CaptionCheckTableCheckAttribs.cs

示例4: PreTraverse

        protected internal virtual void PreTraverse(Node node)
        {
            if (node == null)
            {
                return;
            }

            if (node.Type == Node.StartTag || node.Type == Node.StartEndTag)
            {
                if (_currIndex <= _maxIndex && (_tagName.Equals("*") || _tagName.Equals(node.Element)))
                {
                    _currIndex += 1;
                    _currNode = node;
                }
            }
            if (_currIndex > _maxIndex)
            {
                return;
            }

            node = node.Content;
            while (node != null)
            {
                PreTraverse(node);
                node = node.Next;
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:27,代碼來源:DomNodeListByTagNameImpl.cs

示例5: Check

 public virtual void Check(Lexer lexer, Node node)
 {
     if (node.GetAttrByName("src") != null)
     {
         Report.AttrError(lexer, node, "src", Report.PROPRIETARY_ATTR_VALUE);
     }
 }
開發者ID:AlfieJ,項目名稱:TidyNet,代碼行數:7,代碼來源:HrCheckTableCheckAttribs.cs

示例6: Check

        public virtual void Check(Lexer lexer, Node node, AttVal attval)
        {
            string val = attval.Val;

            if (val == null)
            {
                Report.AttrError(lexer, node, attval.Attribute, Report.MISSING_ATTR_VALUE);
            }
            else if (String.Compare(val, "top") == 0 || String.Compare(val, "middle") == 0 || String.Compare(val, "bottom") == 0 || String.Compare(val, "baseline") == 0)
            {
                /* all is fine */
            }
            else if (String.Compare(val, "left") == 0 || String.Compare(val, "right") == 0)
            {
                if (!(node.Tag != null && ((node.Tag.Model & ContentModel.Img) != 0)))
                {
                    Report.AttrError(lexer, node, val, Report.BAD_ATTRIBUTE_VALUE);
                }
            }
            else if (String.Compare(val, "texttop") == 0 || String.Compare(val, "absmiddle") == 0 || String.Compare(val, "absbottom") == 0 || String.Compare(val, "textbottom") == 0)
            {
                lexer.versions &= HtmlVersion.Proprietary;
                Report.AttrError(lexer, node, val, Report.PROPRIETARY_ATTR_VALUE);
            }
            else
            {
                Report.AttrError(lexer, node, val, Report.BAD_ATTRIBUTE_VALUE);
            }
        }
開發者ID:AlfieJ,項目名稱:TidyNet,代碼行數:29,代碼來源:ValignAttrCheck.cs

示例7: Check

 public virtual void Check(Lexer lexer, Node node, AttVal attval)
 {
     if (attval.Val == null)
     {
         Report.AttrError(lexer, node, attval.Attribute, Report.MISSING_ATTR_VALUE);
     }
     else if (lexer.Options.FixBackslash)
     {
         attval.Val = attval.Val.Replace('\\', '/');
     }
 }
開發者ID:AlfieJ,項目名稱:TidyNet,代碼行數:11,代碼來源:UrlAttrCheck.cs

示例8: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            AttVal type = node.GetAttrByName("type");

            node.CheckUniqueAttributes(lexer);

            if (type == null)
            {
                Report.AttrError(lexer, node, "type", Report.MISSING_ATTRIBUTE);

                node.AddAttribute("type", "text/css");
            }
        }
開發者ID:AlfieJ,項目名稱:TidyNet,代碼行數:13,代碼來源:StyleCheckTableCheckAttribs.cs

示例9: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            node.CheckUniqueAttributes(lexer);

            /*
                HTML4 strict doesn't allow mixed content for
                elements with %block; as their content model
                */
            if (node.GetAttrByName("width") != null || node.GetAttrByName("height") != null)
            {
                lexer.versions &= ~ HtmlVersion.Html40Strict;
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:13,代碼來源:TableCellCheckTableCheckAttribs.cs

示例10: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            AttVal attval;

            node.CheckUniqueAttributes(lexer);

            for (attval = node.Attributes; attval != null; attval = attval.Next)
            {
                Attribute attribute = attval.CheckAttribute(lexer, node);
                if (attribute == AttributeTable.AttrXmlns)
                {
                    lexer.isvoyager = true;
                }
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:15,代碼來源:HtmlCheckAttribs.cs

示例11: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            AttVal rel = node.GetAttrByName("rel");

            node.CheckUniqueAttributes(lexer);

            if (rel != null && rel.Val != null && rel.Val.Equals("stylesheet"))
            {
                AttVal type = node.GetAttrByName("type");

                if (type == null)
                {
                    Report.AttrError(lexer, node, "type", Report.MISSING_ATTRIBUTE);

                    node.AddAttribute("type", "text/css");
                }
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:18,代碼來源:LinkCheckTableCheckAttribs.cs

示例12: Check

        public virtual void Check(Lexer lexer, Node node, AttVal attval)
        {
            string val;

            /* IMG, OBJECT, APPLET and EMBED use align for vertical position */
            if (node.Tag != null && ((node.Tag.Model & ContentModel.Img) != 0))
            {
                TidyNet.AttrCheckImpl.CheckValign.Check(lexer, node, attval);
                return;
            }

            val = attval.Val;

            if (val == null)
            {
                Report.AttrError(lexer, node, attval.Attribute, Report.MISSING_ATTR_VALUE);
            }
            else if (!(String.Compare(val, "left") == 0 || String.Compare(val, "center") == 0 || String.Compare(val, "right") == 0 || String.Compare(val, "justify") == 0))
            {
                Report.AttrError(lexer, node, attval.Val, Report.BAD_ATTRIBUTE_VALUE);
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:22,代碼來源:AlignAttrCheck.cs

示例13: Check

        public virtual void Check(Lexer lexer, Node node)
        {
            AttVal attval;
            Attribute attribute;
            bool hasSummary = false;

            node.CheckUniqueAttributes(lexer);

            for (attval = node.Attributes; attval != null; attval = attval.Next)
            {
                attribute = attval.CheckAttribute(lexer, node);

                if (attribute == AttributeTable.AttrSummary)
                {
                    hasSummary = true;
                }
            }

            /* suppress warning for missing summary for HTML 2.0 and HTML 3.2 */
            if (!hasSummary && lexer.doctype != HtmlVersion.Html20 && lexer.doctype != HtmlVersion.Html32)
            {
                lexer.badAccess |= Report.MISSING_SUMMARY;
                Report.AttrError(lexer, node, "summary", Report.MISSING_ATTRIBUTE);
            }

            /* convert <table border> to <table border="1"> */
            if (lexer.Options.XmlOut)
            {
                attval = node.GetAttrByName("border");
                if (attval != null)
                {
                    if (attval.Val == null)
                    {
                        attval.Val = "1";
                    }
                }
            }
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:38,代碼來源:TableCheckAttribs.cs

示例14: FindParser

        public IParser FindParser(Node node)
        {
            Dict np;

            if (node.Element != null)
            {
                np = Lookup(node.Element);
                if (np != null)
                {
                    return np.Parser;
                }
            }

            return null;
        }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:15,代碼來源:TagTable.cs

示例15: DomNodeImpl

 protected internal DomNodeImpl(Node adaptee)
 {
     _adaptee = adaptee;
 }
開發者ID:bgarrels,項目名稱:betterpoeditor,代碼行數:4,代碼來源:DomNodeImpl.cs


注:本文中的TidyNet.Node類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。