⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node.cs

📁 Freetextbox是优秀的在线编辑器
💻 CS
字号:
namespace FreeTextBoxControls.Support.Sgml
{
    using System;
    using System.Xml;

    internal class Node
    {
        public Node()
        {
            this.attributes = new FreeTextBoxControls.Support.Sgml.HWStack(10);
        }

        public FreeTextBoxControls.Support.Sgml.Attribute AddAttribute(string name, string value, char quotechar, bool caseInsensitive)
        {
            FreeTextBoxControls.Support.Sgml.Attribute attribute1;
            int num1 = 0;
            int num2 = this.attributes.Count;
            while (num1 < num2)
            {
                attribute1 = (FreeTextBoxControls.Support.Sgml.Attribute) this.attributes[num1];
                if (caseInsensitive && (string.Compare(attribute1.Name, name, true) == 0))
                {
                    return null;
                }
                if (attribute1.Name == name)
                {
                    return null;
                }
                num1++;
            }
            attribute1 = (FreeTextBoxControls.Support.Sgml.Attribute) this.attributes.Push();
            if (attribute1 == null)
            {
                attribute1 = new FreeTextBoxControls.Support.Sgml.Attribute();
                this.attributes[this.attributes.Count - 1] = attribute1;
            }
            attribute1.Reset(name, value, quotechar);
            return attribute1;
        }

        public void CopyAttributes(Node n)
        {
            int num1 = 0;
            int num2 = n.attributes.Count;
            while (num1 < num2)
            {
                FreeTextBoxControls.Support.Sgml.Attribute attribute1 = (FreeTextBoxControls.Support.Sgml.Attribute) n.attributes[num1];
                FreeTextBoxControls.Support.Sgml.Attribute attribute2 = this.AddAttribute(attribute1.Name, attribute1.Value, attribute1.QuoteChar, false);
                attribute2.DtdType = attribute1.DtdType;
                num1++;
            }
        }

        public FreeTextBoxControls.Support.Sgml.Attribute GetAttribute(int i)
        {
            if ((i >= 0) && (i < this.attributes.Count))
            {
                return (FreeTextBoxControls.Support.Sgml.Attribute) this.attributes[i];
            }
            return null;
        }

        public int GetAttribute(string name)
        {
            int num1 = 0;
            int num2 = this.attributes.Count;
            while (num1 < num2)
            {
                FreeTextBoxControls.Support.Sgml.Attribute attribute1 = (FreeTextBoxControls.Support.Sgml.Attribute) this.attributes[num1];
                if (attribute1.Name == name)
                {
                    return num1;
                }
                num1++;
            }
            return -1;
        }

        public void RemoveAttribute(string name)
        {
            int num1 = 0;
            int num2 = this.attributes.Count;
            while (num1 < num2)
            {
                FreeTextBoxControls.Support.Sgml.Attribute attribute1 = (FreeTextBoxControls.Support.Sgml.Attribute) this.attributes[num1];
                if (attribute1.Name == name)
                {
                    this.attributes.RemoveAt(num1);
                    return;
                }
                num1++;
            }
        }

        public void Reset(string name, XmlNodeType nt, string value)
        {
            this.Value = value;
            this.Name = name;
            this.NodeType = nt;
            this.Space = XmlSpace.None;
            this.XmlLang = null;
            this.IsEmpty = true;
            this.attributes.Count = 0;
            this.DtdType = null;
        }


        public int AttributeCount
        {
            get
            {
                return this.attributes.Count;
            }
        }


        private FreeTextBoxControls.Support.Sgml.HWStack attributes;
        internal FreeTextBoxControls.Support.Sgml.State CurrentState;
        internal ElementDecl DtdType;
        internal bool IsEmpty;
        internal string Name;
        internal XmlNodeType NodeType;
        internal XmlSpace Space;
        internal string Value;
        internal string XmlLang;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -