コード例 #1
0
        internal int method_26(Regex A_0, TextBodyPart A_1, bool A_2)
        {
            int num = 12;

            if (Class191.smethod_0(A_0))
            {
                throw new ArgumentException(BookmarkStart.b("愱儳圵䨷夹吻ḽ㌿㙁㙃⽅♇ⵉ汋ⵍㅏ㱑㩓㥕ⱗ穙㹛㭝䁟ݡॣᙥᱧ፩", num));
            }
            Class185 class2 = this.method_23(A_0);

            if (class2 == null)
            {
                return(0);
            }
            foreach (TextSelection selection in class2)
            {
                CharacterFormat characterFormat = null;
                if (A_2)
                {
                    characterFormat = selection.StartTextRange.CharacterFormat;
                }
                int       num2           = selection.method_0();
                Paragraph ownerParagraph = selection.OwnerParagraph;
                A_1.method_1(ownerParagraph.OwnerTextBody, ownerParagraph.method_5(), num2, characterFormat, A_2);
                if (base.Document.ReplaceFirst)
                {
                    break;
                }
            }
            return(class2.Count);
        }
コード例 #2
0
        public override int Replace(Regex pattern, TextSelection textSelection, bool saveFormatting)
        {
            int num = 12;

            if (Class191.smethod_0(pattern))
            {
                throw new ArgumentException(BookmarkStart.b("愱儳圵䨷夹吻ḽ㌿㙁㙃⽅♇ⵉ汋ⵍㅏ㱑㩓㥕ⱗ穙㹛㭝䁟ݡॣᙥᱧ፩", num));
            }
            textSelection.method_1();
            Class185 class2 = this.FindAll(pattern);

            if (class2 == null)
            {
                return(0);
            }
            foreach (TextSelection selection in class2)
            {
                CharacterFormat characterFormat = null;
                if ((selection.StartTextRange != null) && saveFormatting)
                {
                    characterFormat = selection.StartTextRange.CharacterFormat;
                }
                int       num2           = selection.method_0();
                Paragraph ownerParagraph = selection.OwnerParagraph;
                if (selection.OwnerSDTInlineContent != null)
                {
                    textSelection.method_3(selection.OwnerSDTInlineContent, num2, saveFormatting, characterFormat);
                }
                else
                {
                    textSelection.method_2(ownerParagraph, num2, saveFormatting, characterFormat);
                }
            }
            return(class2.Count);
        }
コード例 #3
0
        public override int Replace(Regex pattern, string replace)
        {
            int num3;
            int num = 0x12;

            if (Class191.smethod_0(pattern))
            {
                throw new ArgumentException(BookmarkStart.b("欷弹崻䰽⌿⩁摃㕅㱇㡉╋⁍㝏牑㝓㝕㙗㑙㍛⩝䁟aţ䙥൧ݩᱫᩭ९", num));
            }
            int num2 = 0;

            using (IEnumerator enumerator = this.ChildObjects.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BodyRegion current = (BodyRegion)enumerator.Current;
                    num2 += current.Replace(pattern, replace);
                    if (base.Document.ReplaceFirst && (num2 > 0))
                    {
                        goto Label_0064;
                    }
                }
                return(num2);

Label_0064:
                num3 = num2;
            }
            return(num3);
        }
コード例 #4
0
        internal int method_27(Regex A_0, string A_1)
        {
            int num = 0x12;

            if (Class191.smethod_0(A_0))
            {
                throw new ArgumentException(BookmarkStart.b("欷弹崻䰽⌿⩁摃㕅㱇㡉╋⁍㝏牑㝓㝕㙗㑙㍛⩝䁟aţ䙥൧ݩᱫᩭ९", num));
            }
            return(this.Replace(A_0, A_1));
        }
コード例 #5
0
        internal int method_27(Regex A_0, IDocument A_1, bool A_2)
        {
            int num = 7;

            if (Class191.smethod_0(A_0))
            {
                throw new ArgumentException(BookmarkStart.b("縬䨮倰䄲嘴弶ᤸ䠺䤼䴾⡀ⵂ≄杆⩈⩊⍌ⅎ㹐❒畔㕖㱘筚㡜㉞ᅠᝢᱤ", num));
            }
            CharacterFormat characterFormat = null;
            Class185        class2          = this.method_23(A_0);

            if (class2 == null)
            {
                return(0);
            }
            foreach (TextSelection selection in class2)
            {
                if (A_2)
                {
                    characterFormat = selection.StartTextRange.CharacterFormat;
                }
                int       num3           = selection.method_0();
                Paragraph ownerParagraph = selection.OwnerParagraph;
                for (int i = A_1.Sections.Count - 1; i >= 0; i--)
                {
                    ISection section = A_1.Sections[i];
                    if (!A_2)
                    {
                        base.Document.CurClonedSection = section as Section;
                    }
                    TextBodyPart part = new TextBodyPart(base.Document);
                    part.method_0(section.Body, false);
                    part.method_1(ownerParagraph.OwnerTextBody, ownerParagraph.method_5(), num3, characterFormat, A_2);
                }
                if (base.Document.ReplaceFirst)
                {
                    break;
                }
            }
            return(class2.Count);
        }
コード例 #6
0
        private void method_6(JsonWriter jsonWriter_0, Interface10 interface10_0, XmlNamespaceManager xmlNamespaceManager_0, bool bool_2)
        {
            Func <Interface10, bool> predicate = null;
            Class105 class2 = new Class105 {
                interface10_0 = interface10_0
            };

            switch (class2.interface10_0.XmlNodeType_0)
            {
            case XmlNodeType.Element:
                if (this.method_4(class2.interface10_0))
                {
                    if (predicate == null)
                    {
                        predicate = new Func <Interface10, bool>(class2.method_0);
                    }
                    if (class2.interface10_0.Prop_0.All <Interface10>(predicate) && (class2.interface10_0.Prop_0.Count > 0))
                    {
                        this.method_5(jsonWriter_0, class2.interface10_0, xmlNamespaceManager_0, false);
                        return;
                    }
                }
                xmlNamespaceManager_0.PushScope();
                foreach (Interface10 interface2 in class2.interface10_0.Prop_1)
                {
                    if (interface2.String_2 == "http://www.w3.org/2000/xmlns/")
                    {
                        string prefix = (interface2.String_0 != "xmlns") ? interface2.String_0 : string.Empty;
                        string uri    = interface2.String_1;
                        xmlNamespaceManager_0.AddNamespace(prefix, uri);
                    }
                }
                if (bool_2)
                {
                    jsonWriter_0.WritePropertyName(this.method_3(class2.interface10_0, xmlNamespaceManager_0));
                }
                if ((!this.method_17(class2.interface10_0.Prop_1).Any <Interface10>() && (class2.interface10_0.Prop_0.Count == 1)) && (class2.interface10_0.Prop_0[0].XmlNodeType_0 == XmlNodeType.Text))
                {
                    jsonWriter_0.WriteValue(class2.interface10_0.Prop_0[0].String_1);
                }
                else if ((class2.interface10_0.Prop_0.Count == 0) && Class191.smethod_0 <Interface10>(class2.interface10_0.Prop_1))
                {
                    jsonWriter_0.WriteNull();
                }
                else
                {
                    jsonWriter_0.WriteStartObject();
                    for (int i = 0; i < class2.interface10_0.Prop_1.Count; i++)
                    {
                        this.method_6(jsonWriter_0, class2.interface10_0.Prop_1[i], xmlNamespaceManager_0, true);
                    }
                    this.method_5(jsonWriter_0, class2.interface10_0, xmlNamespaceManager_0, true);
                    jsonWriter_0.WriteEndObject();
                }
                xmlNamespaceManager_0.PopScope();
                return;

            case XmlNodeType.Attribute:
            case XmlNodeType.Text:
            case XmlNodeType.CDATA:
            case XmlNodeType.ProcessingInstruction:
            case XmlNodeType.Whitespace:
            case XmlNodeType.SignificantWhitespace:
                if (!(class2.interface10_0.String_2 == "http://www.w3.org/2000/xmlns/") || !(class2.interface10_0.String_1 == "http://james.newtonking.com/projects/json"))
                {
                    if ((class2.interface10_0.String_2 != "http://james.newtonking.com/projects/json") || (class2.interface10_0.String_0 != "Array"))
                    {
                        if (bool_2)
                        {
                            jsonWriter_0.WritePropertyName(this.method_3(class2.interface10_0, xmlNamespaceManager_0));
                        }
                        jsonWriter_0.WriteValue(class2.interface10_0.String_1);
                    }
                    return;
                }
                return;

            case XmlNodeType.Comment:
                if (bool_2)
                {
                    jsonWriter_0.WriteComment(class2.interface10_0.String_1);
                }
                return;

            case XmlNodeType.Document:
            case XmlNodeType.DocumentFragment:
                this.method_5(jsonWriter_0, class2.interface10_0, xmlNamespaceManager_0, bool_2);
                return;

            case XmlNodeType.XmlDeclaration:
            {
                Interface13 interface3 = (Interface13)class2.interface10_0;
                jsonWriter_0.WritePropertyName(this.method_3(class2.interface10_0, xmlNamespaceManager_0));
                jsonWriter_0.WriteStartObject();
                if (!string.IsNullOrEmpty(interface3.String_3))
                {
                    jsonWriter_0.WritePropertyName("@version");
                    jsonWriter_0.WriteValue(interface3.String_3);
                }
                if (!string.IsNullOrEmpty(interface3.String_4))
                {
                    jsonWriter_0.WritePropertyName("@encoding");
                    jsonWriter_0.WriteValue(interface3.String_4);
                }
                if (!string.IsNullOrEmpty(interface3.String_5))
                {
                    jsonWriter_0.WritePropertyName("@standalone");
                    jsonWriter_0.WriteValue(interface3.String_5);
                }
                jsonWriter_0.WriteEndObject();
                return;
            }
            }
            throw new JsonSerializationException("Unexpected XmlNodeType when serializing nodes: " + class2.interface10_0.XmlNodeType_0);
        }