Exemplo n.º 1
0
    private static void smethod_12(Class857 A_0, Paragraph A_1, FieldType A_2, string A_3, string A_4, CharacterFormat A_5, Style A_6)
    {
        Field field;
        int   num = 0x13;

        if (A_5 == null)
        {
            A_5 = A_1.BreakCharacterFormat;
        }
        if (A_2 == FieldType.FieldMergeField)
        {
            field = new MergeField(A_0.method_9());
        }
        else
        {
            field = new Field(A_0.method_9());
        }
        string str = A_3.Trim();

        if (str.EndsWith(BookmarkStart.b("攸ᄺ", num)))
        {
            A_3 = str.Substring(0, str.Length - 2);
        }
        field.Code = A_3;
        if (A_2 == FieldType.FieldMergeField)
        {
            field.ParseFieldCode(field.Code);
        }
        field.ApplyCharacterFormat(A_5);
        field.Type = A_2;
        A_1.method_13(field);
        if (A_2 != FieldType.FieldMergeField)
        {
            FieldMark mark = new FieldMark(A_0.method_9(), FieldMarkType.FieldSeparator);
            mark.ApplyCharacterFormat(A_5);
            TextRange range = new TextRange(A_0.method_9())
            {
                Text = A_4
            };
            range.ApplyCharacterFormat(A_5);
            FieldMark mark2 = new FieldMark(A_0.method_9(), FieldMarkType.FieldEnd);
            mark2.ApplyCharacterFormat(A_5);
            field.Separator = mark;
            field.End       = mark2;
            A_1.method_13(mark);
            A_1.method_13(range);
            A_1.method_13(mark2);
        }
        field.UpdateFieldCode(field.Code);
    }