コード例 #1
0
        private void ChildrenAuslesen(string code)
        {
            string str1 = code;

            this._art = DTDChildElemente.DTDChildElementArten.ChildListe;
            int           num           = 0;
            StringBuilder stringBuilder = new StringBuilder();

            while (code.Length > 0)
            {
                string code1 = code.Substring(0, 1);
                code = code.Remove(0, 1);
                string str2 = code1;
                if (!(str2 == "("))
                {
                    if (str2 == ")")
                    {
                        --num;
                    }
                }
                else
                {
                    ++num;
                }
                if (this.IstOperator(code1))
                {
                    if (num == 0)
                    {
                        this._operator = this.GetOperatorFromChar(code1);
                        string code2 = stringBuilder.ToString().Trim();
                        if (code2.Length == 0)
                        {
                            throw new ApplicationException("Leerer ChildCode gefunden in '" + str1 + "'");
                        }
                        this.SpeichereChildElement(code2);
                        stringBuilder = new StringBuilder();
                    }
                    else
                    {
                        stringBuilder.Append(code1);
                    }
                }
                else
                {
                    stringBuilder.Append(code1);
                }
            }
            if (stringBuilder.Length <= 0)
            {
                return;
            }
            this.SpeichereChildElement(stringBuilder.ToString());
        }
コード例 #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();
     }
 }