コード例 #1
0
        private void CodeAuslesen()
        {
            string str1 = this._quellcode;
            string str2 = str1.Substring(str1.Length - 1, 1);

            if (!(str2 == "+"))
            {
                if (!(str2 == "*"))
                {
                    if (str2 == "?")
                    {
                        this._defAnzahl = DTDChildElemente.DTDChildElementAnzahl.NullOderEinmal;
                        str1            = str1.Remove(str1.Length - 1, 1);
                    }
                    else
                    {
                        this._defAnzahl = DTDChildElemente.DTDChildElementAnzahl.GenauEinmal;
                    }
                }
                else
                {
                    this._defAnzahl = DTDChildElemente.DTDChildElementAnzahl.NullUndMehr;
                    str1            = str1.Remove(str1.Length - 1, 1);
                }
            }
            else
            {
                this._defAnzahl = DTDChildElemente.DTDChildElementAnzahl.EinsUndMehr;
                str1            = str1.Remove(str1.Length - 1, 1);
            }
            string str3 = str1.Trim();

            if (str3.Substring(0, 1) == "(" && str3.Substring(str3.Length - 1, 1) == ")")
            {
                this.ChildrenAuslesen(str3.Substring(1, str3.Length - 2));
            }
            else
            {
                this._art         = DTDChildElemente.DTDChildElementArten.EinzelChild;
                this._elementName = str3;
            }
        }
コード例 #2
0
 public DTDChildElemente(string childrenQuellcode)
 {
     this._art         = DTDChildElemente.DTDChildElementArten.Leer;
     this._children    = new ArrayList();
     this._defAnzahl   = DTDChildElemente.DTDChildElementAnzahl.GenauEinmal;
     this._elementName = "";
     this._operator    = DTDChildElemente.DTDChildElementOperatoren.Oder;
     this._quellcode   = childrenQuellcode;
     this._quellcode   = this._quellcode.Replace("\t", " ");
     this._quellcode   = this._quellcode.Replace("\r\n", " ");
     this._quellcode   = this._quellcode.Trim();
     if (this._quellcode.Length == 0)
     {
         this._art = DTDChildElemente.DTDChildElementArten.Leer;
     }
     else
     {
         this.CodeAuslesen();
     }
 }