Пример #1
0
    private static Class185 smethod_2(SDTInlineContent A_0, Regex A_1, bool A_2)
    {
        string          text   = A_0.Text;
        MatchCollection matchs = A_1.Matches(text);
        Class185        class2 = new Class185();

        if (matchs.Count > 0)
        {
            foreach (Match match in matchs)
            {
                int           index = match.Index;
                int           num2  = match.Index + match.Length;
                TextSelection item  = new TextSelection(A_0, index, num2)
                {
                    class185_0 = class2
                };
                class2.Add(item);
                if (A_2)
                {
                    break;
                }
            }
        }
        smethod_3(A_0, A_1, A_2, class2);
        return(class2);
    }
Пример #2
0
 internal override void Attach(SDTInlineContent owner, int itemPos)
 {
     base.Attach(owner, itemPos);
     if ((base.Owner is SDTInlineContent) && (this.breakType_0 == Spire.Doc.Documents.BreakType.LineBreak))
     {
         (base.Owner as SDTInlineContent).method_23(this, 0, this.textRange_0.Text);
     }
 }
Пример #3
0
    internal static int smethod_2(SDTInlineContent A_0, Regex A_1, string A_2)
    {
        Paragraph ownerParagraph      = A_0.OwnerParagraph;
        ParagraphItemCollection items = A_0.Items;
        string          text          = A_0.Text;
        MatchCollection matchs        = A_1.Matches(text);

        if (matchs.Count > 0)
        {
            int num    = 0;
            int num2   = 0;
            int length = A_2.Length;
            int num4   = 0;
            int num5   = 0;
            foreach (Match match in matchs)
            {
                TextRange range2;
                num4 = match.Index + num;
                num5 = match.Length;
                num2 = length - match.Length;
                A_0.method_24(num4, num5, A_2);
                int num7 = Class191.smethod_4(A_0, num4 + 1, out range2);
                int num9 = range2.StartPos + range2.TextLength;
                range2.SafeText = false;
                if ((num9 <= (num4 + num5)) && ((range2.NextSibling == null) || (range2.NextSibling.DocumentObjectType == DocumentObjectType.TextRange)))
                {
                    ParagraphBase base2;
                    smethod_4(A_0, num4 + num5, num7 + 1, out base2);
                    int num8 = num4 + num5;
                    if (base2 is TextRange)
                    {
                        TextRange range = base2 as TextRange;
                        range.TextLength -= num8 - range.StartPos;
                        range.StartPos    = num8 + num2;
                        num7++;
                    }
                    range2.TextLength = (num8 + num2) - range2.StartPos;
                }
                else
                {
                    range2.TextLength += num2;
                }
                smethod_6(A_0, num7 + 1, num2);
                num += num2;
                if (ownerParagraph.Document.ReplaceFirst)
                {
                    break;
                }
            }
        }
        int count = matchs.Count;

        if (ownerParagraph.Document.ReplaceFirst && (count > 0))
        {
            return(count);
        }
        return(count + smethod_3(A_0, A_1, A_2));
    }
Пример #4
0
    private static void smethod_3(SDTInlineContent A_0, Regex A_1, bool A_2, Class185 A_3)
    {
        if ((A_3.Count <= 0) || !A_2)
        {
            foreach (ParagraphBase base2 in A_0.Items)
            {
                if (A_2 && (A_3.Count > 0))
                {
                    break;
                }
                List <Body> list = Class191.smethod_5(base2);
                if (list.Count > 0)
                {
                    using (List <Body> .Enumerator enumerator2 = list.GetEnumerator())
                    {
                        TextSelection selection;
                        while (enumerator2.MoveNext())
                        {
                            Body current = enumerator2.Current;
                            if (A_2)
                            {
                                selection = current.method_22(A_1);
                                if (selection == null)
                                {
                                    continue;
                                }
                                goto Label_009E;
                            }
                            Class185 collection = current.method_23(A_1);
                            if ((collection != null) && (collection.Count > 0))
                            {
                                A_3.AddRange(collection);
                            }
                        }
                        goto Label_00E4;
Label_009E:
                        A_3.Add(selection);
                        goto Label_00E4;
                    }
                }
                if (base2 is StructureDocumentTagInline)
                {
                    Class185 class2 = smethod_2((base2 as StructureDocumentTagInline).SDTContent, A_1, A_2);
                    if ((class2 != null) && (class2.Count > 0))
                    {
                        A_3.AddRange(class2);
                    }
                }
Label_00E4:
                list.Clear();
                list = null;
            }
        }
    }
Пример #5
0
    private static int smethod_3(SDTInlineContent A_0, Regex A_1, string A_2)
    {
        int       num            = 0;
        Paragraph ownerParagraph = A_0.OwnerParagraph;

        foreach (ParagraphBase base2 in A_0.Items)
        {
            if (ownerParagraph.Document.ReplaceFirst && (num > 0))
            {
                return(num);
            }
            List <Body> list = Class191.smethod_5(base2);
            if (list.Count > 0)
            {
                foreach (Body body in list)
                {
                    num += body.method_24(A_1, A_2);
                    if (ownerParagraph.Document.ReplaceFirst && (num > 0))
                    {
                        break;
                    }
                }
            }
            else
            {
                switch (base2.DocumentObjectType)
                {
                case DocumentObjectType.StructureDocumentTagInline:
                    num += smethod_2((base2 as StructureDocumentTagInline).SDTContent, A_1, A_2);
                    break;

                case DocumentObjectType.Field:
                {
                    Field field = base2 as Field;
                    if (((field.Type == FieldType.FieldHyperlink) && (field.NextSibling.NextSibling is TextRange)) && ((field.NextSibling.NextSibling as TextRange).Text == A_2))
                    {
                        field.Code       = A_1.Replace(field.Code, A_2);
                        field.FieldValue = A_1.Replace(field.Value, A_2);
                        num++;
                    }
                    break;
                }
                }
            }
        }
        return(num);
    }
Пример #6
0
    internal static int smethod_4(SDTInlineContent A_0, int A_1, out TextRange A_2)
    {
        A_2 = null;
        int num2  = 0;
        int count = A_0.Items.Count;

        while (num2 < count)
        {
            A_2 = A_0[num2] as TextRange;
            if ((A_2 != null) && ((A_2.StartPos + A_2.TextLength) >= A_1))
            {
                return(num2);
            }
            num2++;
        }
        return(0);
    }
Пример #7
0
        internal virtual void Attach(SDTInlineContent owner, int itemPos)
        {
            int num = 1;

            if (owner == null)
            {
                throw new ArgumentNullException(BookmarkStart.b("䠦帨䔪䠬崮", num));
            }
            if (this.ItemDetached)
            {
                throw new InvalidOperationException();
            }
            if (owner.OwnerParagraph.BreakCharacterFormat.BaseFormat != null)
            {
                this.CharacterFormat.ApplyBase(owner.OwnerParagraph.BreakCharacterFormat.BaseFormat);
            }
            this.StartPos = itemPos;
        }
Пример #8
0
 private static void smethod_6(SDTInlineContent A_0, int A_1, int A_2)
 {
     smethod_7(A_0.Items, A_1, A_2);
 }
Пример #9
0
 private static void smethod_4(SDTInlineContent A_0, int A_1, int A_2, out ParagraphBase A_3)
 {
     smethod_5(A_0.Items, A_1, A_2, out A_3);
 }
Пример #10
0
 internal override void Attach(SDTInlineContent owner, int itemPos)
 {
     this.int_4 = 0;
     base.Attach(owner, itemPos);
     this.Text = this.string_8;
 }
 internal ParagraphItemCollection(SDTInlineContent A_0) : base(A_0.Document, A_0)
 {
 }