Exemple #1
0
        private void Durchsuchen(DTDChildElemente childBlock)
        {
            switch (childBlock.Art)
            {
            case DTDChildElemente.DTDChildElementArten.EinzelChild:
                this.ElementMerken(childBlock.ElementName);
                break;

            case DTDChildElemente.DTDChildElementArten.ChildListe:
                for (int index = 0; index < childBlock.AnzahlChildren; ++index)
                {
                    this.Durchsuchen(childBlock.Child(index));
                }
                break;
            }
        }
        private void Durchsuchen(DTDChildElemente childBlock)
        {
            switch (childBlock.Art)
            {
            case DTDChildElemente.DTDChildElementArten.Leer:
                break;

            case (DTDChildElemente.DTDChildElementArten) 1:
                break;

            case DTDChildElemente.DTDChildElementArten.EinzelChild:
                this.ElementMerken(childBlock.ElementName);
                break;

            case DTDChildElemente.DTDChildElementArten.ChildListe:
                for (int i = 0; i < childBlock.AnzahlChildren; i++)
                {
                    this.Durchsuchen(childBlock.Child(i));
                }
                break;
            }
        }
Exemple #3
0
        private StringCollection GetDTDElementeNamenAusChildElementen_(
            DTDChildElemente children)
        {
            StringCollection stringCollection = new StringCollection();

            switch (children.Art)
            {
            case DTDChildElemente.DTDChildElementArten.EinzelChild:
                if (!stringCollection.Contains(children.ElementName))
                {
                    stringCollection.Add(children.ElementName);
                    goto case DTDChildElemente.DTDChildElementArten.Leer;
                }
                else
                {
                    goto case DTDChildElemente.DTDChildElementArten.Leer;
                }

            case DTDChildElemente.DTDChildElementArten.Leer:
                return(stringCollection);

            case DTDChildElemente.DTDChildElementArten.ChildListe:
                for (int index = 0; index < children.AnzahlChildren; ++index)
                {
                    foreach (string str in this.GetDTDElementeNamenAusChildElementen_(children.Child(index)))
                    {
                        if (!stringCollection.Contains(str))
                        {
                            stringCollection.Add(str);
                        }
                    }
                }
                goto case DTDChildElemente.DTDChildElementArten.Leer;

            default:
                throw new ApplicationException(string.Format(ResReader.Reader.GetString("UnbekannteDTDChildElementArt"), (object)children.Art));
            }
        }
        private StringCollection GetDTDElementeNamenAusChildElementen_(DTDChildElemente children)
        {
            StringCollection stringCollection = new StringCollection();

            switch (children.Art)
            {
            case DTDChildElemente.DTDChildElementArten.EinzelChild:
                if (!stringCollection.Contains(children.ElementName))
                {
                    stringCollection.Add(children.ElementName);
                }
                break;

            case DTDChildElemente.DTDChildElementArten.ChildListe:
                for (int i = 0; i < children.AnzahlChildren; i++)
                {
                    StringEnumerator enumerator = this.GetDTDElementeNamenAusChildElementen_(children.Child(i)).GetEnumerator();
                    try
                    {
                        while (enumerator.MoveNext())
                        {
                            string current = enumerator.Current;
                            if (!stringCollection.Contains(current))
                            {
                                stringCollection.Add(current);
                            }
                        }
                    }
                    finally
                    {
                        IDisposable disposable = enumerator as IDisposable;
                        if (disposable != null)
                        {
                            disposable.Dispose();
                        }
                    }
                }
                break;

            default:
                throw new ApplicationException(string.Format(ResReader.Reader.GetString("UnbekannteDTDChildElementArt"), children.Art));

            case DTDChildElemente.DTDChildElementArten.Leer:
                break;
            }
            return(stringCollection);
        }