Exemplo n.º 1
0
        // Token: 0x06003492 RID: 13458 RVA: 0x000E9C4C File Offset: 0x000E7E4C
        internal void CoalesceOnlyChildren(ConverterState converterState, int nStart)
        {
            if (nStart >= this.Count || nStart < 0)
            {
                return;
            }
            this.PreCoalesceChildren(converterState, nStart, true);
            DocumentNode documentNode = this.EntryAt(nStart);
            int          num          = documentNode.ChildCount;

            if (nStart + num >= this.Count)
            {
                num = this.Count - nStart - 1;
            }
            int num2 = nStart + num;

            for (int i = num2; i >= nStart; i--)
            {
                DocumentNode documentNode2 = this.EntryAt(i);
                if (documentNode2.ChildCount == 0 && i != nStart)
                {
                    documentNode2.Terminate(converterState);
                }
                else if (documentNode2.ChildCount > 0)
                {
                    if (i != nStart)
                    {
                        documentNode2.AppendXamlPrefix(converterState);
                    }
                    StringBuilder stringBuilder = new StringBuilder(documentNode2.Xaml);
                    int           childCount    = documentNode2.ChildCount;
                    int           num3          = i + childCount;
                    for (int j = i + 1; j <= num3; j++)
                    {
                        DocumentNode documentNode3 = this.EntryAt(j);
                        stringBuilder.Append(documentNode3.Xaml);
                    }
                    documentNode2.Xaml = stringBuilder.ToString();
                    if (i != nStart)
                    {
                        documentNode2.AppendXamlPostfix(converterState);
                        documentNode2.IsTerminated = true;
                    }
                    this.Excise(i + 1, childCount);
                    num2 -= childCount;
                }
            }
        }