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

📄 attdef.cs

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

    public class AttDef
    {
        public AttDef(string name)
        {
            this.Name = name;
        }

        public bool SetPresence(string token)
        {
            bool flag1 = true;
            if (token == "FIXED")
            {
                this.Presence = AttributePresence.FIXED;
                return flag1;
            }
            if (token == "REQUIRED")
            {
                this.Presence = AttributePresence.REQUIRED;
                return false;
            }
            if (token == "IMPLIED")
            {
                this.Presence = AttributePresence.IMPLIED;
                return false;
            }
            throw new Exception(string.Format("Attribute value '{0}' not supported", token));
        }

        public void SetType(string type)
        {
            string text1 = type;
            if (text1 != null)
            {
                int num1;
                if (<PrivateImplementationDetails>{621EEA27-812F-4C37-8F4B-11BD0CF27F8F}.$$method0x600012f-1 == null)
                {
                    Dictionary<string, int> dictionary1 = new Dictionary<string, int>(14);
                    dictionary1.Add("CDATA", 0);
                    dictionary1.Add("ENTITY", 1);
                    dictionary1.Add("ENTITIES", 2);
                    dictionary1.Add("ID", 3);
                    dictionary1.Add("IDREF", 4);
                    dictionary1.Add("IDREFS", 5);
                    dictionary1.Add("NAME", 6);
                    dictionary1.Add("NAMES", 7);
                    dictionary1.Add("NMTOKEN", 8);
                    dictionary1.Add("NMTOKENS", 9);
                    dictionary1.Add("NUMBER", 10);
                    dictionary1.Add("NUMBERS", 11);
                    dictionary1.Add("NUTOKEN", 12);
                    dictionary1.Add("NUTOKENS", 13);
                    <PrivateImplementationDetails>{621EEA27-812F-4C37-8F4B-11BD0CF27F8F}.$$method0x600012f-1 = dictionary1;
                }
                if (<PrivateImplementationDetails>{621EEA27-812F-4C37-8F4B-11BD0CF27F8F}.$$method0x600012f-1.TryGetValue(text1, out num1))
                {
                    switch (num1)
                    {
                        case 0:
                            this.Type = AttributeType.CDATA;
                            return;

                        case 1:
                            this.Type = AttributeType.ENTITY;
                            return;

                        case 2:
                            this.Type = AttributeType.ENTITIES;
                            return;

                        case 3:
                            this.Type = AttributeType.ID;
                            return;

                        case 4:
                            this.Type = AttributeType.IDREF;
                            return;

                        case 5:
                            this.Type = AttributeType.IDREFS;
                            return;

                        case 6:
                            this.Type = AttributeType.NAME;
                            return;

                        case 7:
                            this.Type = AttributeType.NAMES;
                            return;

                        case 8:
                            this.Type = AttributeType.NMTOKEN;
                            return;

                        case 9:
                            this.Type = AttributeType.NMTOKENS;
                            return;

                        case 10:
                            this.Type = AttributeType.NUMBER;
                            return;

                        case 11:
                            this.Type = AttributeType.NUMBERS;
                            return;

                        case 12:
                            this.Type = AttributeType.NUTOKEN;
                            return;

                        case 13:
                            this.Type = AttributeType.NUTOKENS;
                            return;
                    }
                }
            }
            throw new Exception("Attribute type '" + type + "' is not supported");
        }


        public string Default;
        public string[] EnumValues;
        public string Name;
        public AttributePresence Presence;
        public AttributeType Type;
    }
}

⌨️ 快捷键说明

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