Example #1
0
        private void method_35()
        {
            string text = string.Empty;

            if ((this.Text != Class816.string_9) && this.Text.Contains(Class816.string_9))
            {
                ParagraphItemCollection items = (base.Owner is SDTInlineContent) ? (base.Owner as SDTInlineContent).Items : ((base.OwnerParagraph != null) ? base.OwnerParagraph.Items : null);
                if (items != null)
                {
                    int index = this.Text.IndexOf(Class816.string_9);
                    text = this.Text;
                    int       num    = items.IndexOf(this);
                    string    str2   = text.Substring(index + 1);
                    TextRange entity = base.Clone() as TextRange;
                    if (index > 0)
                    {
                        entity.Text = text.Substring(index);
                        this.Text   = text.Substring(0, index);
                    }
                    else if (str2 != string.Empty)
                    {
                        entity.Text = str2;
                        this.Text   = Class816.string_9;
                    }
                    items.Insert(num + 1, entity);
                }
            }
        }
Example #2
0
 private void method_36()
 {
     if (!this.bool_8)
     {
         string str = string.Empty;
         if (this.Text.Replace(Class816.string_4, Class816.string_27).Replace('\n', '\r').Contains(Class816.string_27))
         {
             ParagraphItemCollection items = (base.Owner is SDTInlineContent) ? (base.Owner as SDTInlineContent).Items : ((base.OwnerParagraph != null) ? base.OwnerParagraph.Items : null);
             if (items != null)
             {
                 TextRange entity = (this.textRange_0 != null) ? this.textRange_0 : this;
                 str = entity.Text.Replace(Class816.string_4, Class816.string_27).Replace('\n', '\r');
                 int       index  = str.IndexOf(Class816.string_27);
                 string    str2   = str.Substring(index + 1);
                 TextRange range2 = entity.Clone() as TextRange;
                 if ((this.textRange_0 != null) && (this.int_4 > 0))
                 {
                     this.int_4--;
                 }
                 if (index > 0)
                 {
                     range2.Text = str.Substring(index + 1);
                     entity.Text = str.Substring(0, index);
                 }
                 else if (str2 != string.Empty)
                 {
                     range2.Text = str2;
                     entity.Text = string.Empty;
                 }
                 if (str == Class816.string_27)
                 {
                     entity.Text = string.Empty;
                     range2.Text = string.Empty;
                 }
                 Paragraph paragraph2 = (base.Owner is SDTInlineContent) ? (base.Owner as SDTInlineContent).OwnerParagraph : base.OwnerParagraph;
                 Paragraph paragraph  = paragraph2.Clone() as Paragraph;
                 paragraph.method_57();
                 int num7 = paragraph2.method_5();
                 paragraph2.OwnerTextBody.Items.Insert(num7 + 1, paragraph);
                 (paragraph2.interface23_0 as Class213).method_38(false);
                 paragraph.Items.Add(range2);
                 int num2 = items.IndexOf(entity);
                 if (num2 > -1)
                 {
                     int num = (base.Document != null) ? base.Document.ClonedFields.Count : 0;
                     paragraph.method_67(items, num2 + 1);
                     int num5 = (base.Document != null) ? base.Document.ClonedFields.Count : 0;
                     int num4 = 0;
                     int num6 = num5 - num;
                     while (num4 < num6)
                     {
                         base.Document.ClonedFields.Pop();
                         num4++;
                     }
                     if (base.IsAddForIfField)
                     {
                         paragraph.IsAddForIfField = true;
                         base.m_doc.LayoutVariables.method_1().Add(paragraph);
                     }
                 }
             }
         }
     }
 }