Пример #1
0
    private static int smethod_1(Paragraph A_0, Regex A_1, string A_2)
    {
        int num = 0;

        foreach (ParagraphBase base2 in A_0.Items)
        {
            if (A_0.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 (A_0.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 != null)) && ((field.NextSibling.NextSibling is TextRange) && ((field.NextSibling.NextSibling as TextRange).Text == A_2)))
                    {
                        bool flag = false;
                        if (!string.IsNullOrEmpty(field.Code))
                        {
                            field.Code = A_1.Replace(field.Code, A_2);
                            num++;
                            flag = true;
                        }
                        if (!string.IsNullOrEmpty(field.Value))
                        {
                            field.FieldValue = A_1.Replace(field.Value, A_2);
                            if (!flag)
                            {
                                num++;
                            }
                        }
                    }
                    break;
                }
                }
            }
        }
        return(num);
    }
Пример #2
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;
            }
        }
    }
Пример #3
0
    internal TextSelection[] method_4(Paragraph A_0, Regex A_1, int A_2, int A_3)
    {
        if (!this.method_0().Contains(A_0))
        {
            this.method_0().Add(A_0);
        }
        Class185 class2 = null;

        for (int i = A_2; i <= A_3; i++)
        {
            ParagraphBase base2 = A_0[i];
            List <Body>   list  = Class191.smethod_5(base2);
            if (list.Count > 0)
            {
                foreach (Body body in list)
                {
                    TextSelection[] collection = this.method_2(body, A_1);
                    if (collection != null)
                    {
                        if (class2 == null)
                        {
                            class2 = new Class185();
                        }
                        class2.AddRange(collection);
                    }
                }
            }
            list.Clear();
            list = null;
        }
        if ((class2 != null) && (class2.Count > 0))
        {
            return(class2.ToArray());
        }
        return(null);
    }