Exemple #1
0
    internal static int smethod_3(Document A_0, BinaryWriter A_1)
    {
        int      num      = 14;
        Class907 settings = A_0.Settings;
        int      position = (int)A_1.BaseStream.Position;
        int      num3     = 0;

        num3  = 0 | (settings.bool_37 ? 1 : 0);
        num3 |= settings.bool_67 ? 2 : 0;
        num3 |= (settings.class460_0.method_27() != MailMergeMainDocumentType.NotAMergeDocument) ? 4 : 0;
        num3 |= ((int)A_0.FootnoteOptions.Position) << 5;
        A_1.Write((ushort)num3);
        num3  = 0;
        num3  = (int)(FootnoteRestartRule.DoNotRestart | A_0.FootnoteOptions.RestartRule);
        num3 |= A_0.FootnoteOptions.StartNumber << 2;
        A_1.Write((ushort)num3);
        num3  = 0;
        num3  = 0xf1;
        num3  = 0xf1 | (!settings.bool_28 ? 0x800 : 0);
        num3 |= settings.bool_27 ? 0x1000 : 0;
        num3 |= settings.bool_16 ? 0x4000 : 0;
        num3 |= settings.bool_21 ? 0x8000 : 0;
        A_1.Write((ushort)num3);
        num3  = 0;
        num3  = 0x80;
        num3  = 0x80 | (settings.bool_63 ? 4 : 0);
        num3 |= settings.bool_64 ? 8 : 0;
        num3 |= settings.bool_34 ? 0x10 : 0;
        num3 |= settings.bool_11 ? 0x20 : 0;
        num3 |= settings.bool_36 ? 0x200 : 0;
        num3 |= settings.bool_0 ? 0x400 : 0;
        num3 |= settings.method_1() ? 0x800 : 0;
        num3 |= settings.bool_65 ? 0x1000 : 0;
        num3 |= settings.bool_35 ? 0x4000 : 0;
        num3 |= settings.bool_7 ? 0x8000 : 0;
        A_1.Write((ushort)num3);
        Class908 class3 = settings.method_5();

        num3 = smethod_5(class3);
        A_1.Write((ushort)num3);
        A_1.Write((ushort)settings.float_0);
        A_1.Write((ushort)0);
        A_1.Write((ushort)settings.int_16);
        A_1.Write((ushort)settings.int_15);
        A_1.Write((ushort)0);
        Class353.smethod_4(A_0.BuiltinDocumentProperties.CreateDate, A_1);
        Class353.smethod_4(A_0.BuiltinDocumentProperties.LastSaveDate, A_1);
        Class353.smethod_4(A_0.BuiltinDocumentProperties.LastPrinted, A_1);
        if (!string.IsNullOrEmpty(A_0.BuiltinDocumentProperties.RevisionNumber))
        {
            A_1.Write(short.Parse(A_0.BuiltinDocumentProperties.RevisionNumber));
        }
        else
        {
            A_1.Write((short)1);
        }
        A_1.Write(int.Parse(A_0.BuiltinDocumentProperties.TotalEditingTime.Minutes.ToString()));
        A_1.Write(A_0.BuiltinDocumentProperties.WordCount);
        A_1.Write(A_0.BuiltinDocumentProperties.CharCount);
        A_1.Write((short)1);
        A_1.Write(A_0.BuiltinDocumentProperties.ParagraphCount);
        num3  = 0;
        num3  = (int)(FootnoteRestartRule.DoNotRestart | A_0.EndnoteOptions.RestartRule);
        num3 |= A_0.EndnoteOptions.StartNumber << 2;
        A_1.Write((ushort)num3);
        num3  = 0;
        num3  = (int)(FootnotePosition.PrintAsEndOfSection | A_0.EndnoteOptions.Position);
        num3 |= settings.bool_6 ? 0x400 : 0;
        num3 |= settings.bool_10 ? 0x800 : 0;
        num3 |= !settings.bool_41 ? 0x1000 : 0;
        A_1.Write((ushort)num3);
        A_1.Write(1);
        A_1.Write(0);
        A_1.Write(0);
        A_1.Write((short)1);
        A_1.Write(1);
        A_1.Write(1);
        A_1.Write((int)A_0.LegacyHash);
        num3  = 0;
        num3  = (int)(DocumentViewType.None | A_0.ViewSetup.DocumentViewType);
        num3 |= A_0.ViewSetup.ZoomPercent << 3;
        num3 |= ((int)A_0.ViewSetup.ZoomType) << 12;
        num3 |= settings.bool_15 ? 0x8000 : 0;
        A_1.Write((ushort)num3);
        num3 = smethod_5(class3);
        A_1.Write((uint)num3);
        A_1.Write((ushort)settings.autoFormatDocumentType_0);
        num3  = 0;
        num3  = 0 | (settings.bool_42 ? 1 : 0);
        num3 |= ((int)settings.characterSpacing_0) << 1;
        num3 |= settings.bool_44 ? 8 : 0;
        num3 |= settings.bool_43 ? 0x20 : 0;
        int num5 = Class813.smethod_24(settings.localeIDs_0);

        num3 |= num5 << 7;
        A_1.Write((ushort)num3);
        char[] destination = new char[0x65];
        int    count       = 0;

        if (settings.string_2 != null)
        {
            count = Math.Min(0x65, settings.string_2.Length);
            settings.string_2.CopyTo(0, destination, 0, count);
        }
        char[] chArray2 = new char[0x33];
        int    num7     = 0;

        if (settings.string_1 != null)
        {
            num7 = Math.Min(0x33, settings.string_1.Length);
            settings.string_1.CopyTo(0, chArray2, 0, num7);
        }
        A_1.Write((short)count);
        A_1.Write((short)num7);
        A_1.Write(destination);
        A_1.Write(chArray2);
        A_1.Write((short)settings.int_23);
        A_1.Write((short)settings.int_24);
        A_1.Write((short)settings.int_19);
        A_1.Write((short)settings.int_20);
        num3  = 0;
        num3  = 0 | settings.int_22;
        num3 |= settings.bool_68 ? 0x80 : 0;
        num3 |= settings.int_21 << 8;
        num3 |= settings.bool_40 ? 0x8000 : 0;
        A_1.Write((ushort)num3);
        num3  = 0;
        num3  = 0 | (settings.int_28 << 1);
        num3 |= (settings.proofState_1 != ProofState.None) ? 0x20 : 0;
        num3 |= (settings.proofState_1 == ProofState.Clean) ? 0x40 : 0;
        num3 |= settings.bool_9 ? 0x80 : 0;
        num3 |= settings.bool_69 ? 0x100 : 0;
        num3 |= settings.bool_66 ? 0x200 : 0;
        num3 |= 0x400;
        num3 |= settings.bool_12 ? 0x800 : 0;
        num3 |= !settings.bool_13 ? 0x1000 : 0;
        num3 |= !settings.bool_14 ? 0x2000 : 0;
        A_1.Write((ushort)num3);
        num3 = 0;
        A_1.Write((ushort)0);
        A_1.Write((ushort)0x10);
        A_1.Write((ushort)0x19);
        A_1.Write(100);
        A_1.Write(0x19);
        A_1.Write(0);
        A_1.Write(0);
        A_1.Write((int)A_0.VbaDocumentEvents);
        A_1.Write(0);
        A_1.Write(new byte[30]);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write(0);
        A_1.Write(0);
        A_1.Write(0);
        A_1.Write((short)A_0.FootnoteOptions.NumberFormat);
        A_1.Write((short)A_0.EndnoteOptions.NumberFormat);
        A_1.Write((ushort)0);
        A_1.Write((ushort)0);
        A_1.Write((ushort)0);
        A_1.Write((ushort)settings.int_30);
        num3  = 0;
        num3  = 0 | (settings.bool_29 ? 2 : 0);
        num3 |= !settings.bool_48 ? 0x200 : 0;
        num3 |= settings.bool_46 ? 0x400 : 0;
        num3 |= settings.bool_47 ? 0x800 : 0;
        num3 |= ((int)settings.screenSize_1) << 12;
        num3 |= !settings.bool_50 ? 0x10000 : 0;
        num3 |= !settings.bool_51 ? 0x20000 : 0;
        num3 |= settings.int_25 << 0x12;
        num3 |= 0x10000000;
        A_1.Write(num3);
        num3 = smethod_5(class3);
        A_1.Write((uint)num3);
        num3  = 0;
        num3  = 0 | (class3.method_67() ? 1 : 0);
        num3 |= class3.method_69() ? 2 : 0;
        num3 |= class3.method_71() ? 4 : 0;
        num3 |= class3.method_73() ? 8 : 0;
        num3 |= class3.method_75() ? 0x10 : 0;
        num3 |= class3.method_77() ? 0x20 : 0;
        num3 |= class3.method_79() ? 0x40 : 0;
        num3 |= class3.method_81() ? 0x80 : 0;
        num3 |= class3.method_83() ? 0x100 : 0;
        num3 |= class3.method_85() ? 0x200 : 0;
        num3 |= class3.method_87() ? 0x400 : 0;
        num3 |= class3.method_89() ? 0x800 : 0;
        num3 |= class3.method_91() ? 0x1000 : 0;
        num3 |= class3.method_93() ? 0x2000 : 0;
        num3 |= class3.method_95() ? 0x4000 : 0;
        num3 |= class3.method_97() ? 0x8000 : 0;
        num3 |= class3.method_99() ? 0x10000 : 0;
        num3 |= class3.method_101() ? 0x20000 : 0;
        num3 |= class3.method_103() ? 0x40000 : 0;
        num3 |= class3.method_105() ? 0x80000 : 0;
        num3 |= class3.method_107() ? 0x100000 : 0;
        num3 |= class3.method_109() ? 0x200000 : 0;
        num3 |= class3.method_111() ? 0x400000 : 0;
        num3 |= class3.method_113() ? 0x800000 : 0;
        num3 |= class3.method_115() ? 0x1000000 : 0;
        num3 |= class3.method_117() ? 0x2000000 : 0;
        num3 |= class3.method_119() ? 0x4000000 : 0;
        num3 |= class3.method_121() ? 0x8000000 : 0;
        num3 |= class3.method_123() ? 0x10000000 : 0;
        num3 |= class3.method_125() ? 0x20000000 : 0;
        num3 |= class3.method_127() ? 0x40000000 : 0;
        num3 |= class3.method_129() ? -2147483648 : 0;
        A_1.Write((uint)num3);
        num3 = 0;
        num3 = 0 | (class3.method_131() ? 1 : 0);
        A_1.Write((uint)num3);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        num3  = 0;
        num3  = 0 | (A_0.ViewSetup.DoNotDisplayPageBoundaries ? 0x20000 : 0);
        num3 |= settings.bool_3 ? 0x800000 : 0;
        num3 |= 0x8000000;
        num3 |= settings.bool_52 ? 0x10000000 : 0;
        num3 |= settings.bool_53 ? 0x20000000 : 0;
        num3 |= !settings.bool_58 ? 0x40000000 : 0;
        num3 |= settings.bool_60 ? -2147483648 : 0;
        A_1.Write((uint)num3);
        A_1.Write((uint)0);
        num3  = 0;
        num3  = 0 | (settings.bool_8 ? 1 : 0);
        num3 |= !settings.bool_61 ? 8 : 0;
        num3 |= settings.bool_62 ? 0x10 : 0;
        num3 |= settings.bool_39 ? 0x40 : 0;
        num3 |= settings.bool_38 ? 0x80 : 0;
        num3 |= settings.bool_19 ? 0x800 : 0;
        num3 |= settings.bool_22 ? 0x1000 : 0;
        num3 |= settings.bool_23 ? 0x2000 : 0;
        num3 |= settings.bool_24 ? 0x4000 : 0;
        num3 |= settings.bool_25 ? 0x8000 : 0;
        A_1.Write((ushort)num3);
        A_1.Write((ushort)settings.int_31);
        A_1.Write((ushort)0);
        A_1.Write((ushort)settings.int_32);
        A_1.Write((ushort)settings.int_18);
        A_1.Write((uint)settings.int_27);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)settings.int_26);
        num3  = 0;
        num3  = 0 | ((A_0.ProtectionType == ProtectionType.AllowOnlyReading) ? 1 : 0);
        num3 |= settings.bool_1 ? 2 : 0;
        num3 |= settings.bool_2 ? 4 : 0;
        num3 |= settings.bool_54 ? 8 : 0;
        num3 |= settings.bool_59 ? 0x10 : 0;
        num3 |= settings.bool_56 ? 0x80 : 0;
        num3 |= settings.bool_57 ? 0x100 : 0;
        num3 |= settings.bool_18 ? 0x800 : 0;
        num3 |= settings.bool_17 ? 0x1000 : 0;
        A_1.Write((uint)num3);
        num3  = 0;
        num3  = 0 | (settings.bool_30 ? 1 : 0);
        num3 |= settings.bool_26 ? 2 : 0;
        num3 |= settings.bool_31 ? 4 : 0;
        num3 |= settings.bool_32 ? 8 : 0;
        switch (A_0.ProtectionType)
        {
        case ProtectionType.NoProtection:
            num3 |= settings.bool_32 ? 0x70 : 0x30;
            break;

        case ProtectionType.AllowOnlyRevisions:
            break;

        case ProtectionType.AllowOnlyComments:
            num3 |= 0x10;
            break;

        case ProtectionType.AllowOnlyFormFields:
            num3 |= 0x20;
            break;

        case ProtectionType.AllowOnlyReading:
            num3 |= 0x30;
            break;

        default:
            throw new InvalidOperationException(BookmarkStart.b("愳堵匷吹医䤽⸿扁⁃⥅⭇㽉⅋⭍㹏♑瑓♕⩗㕙⡛㭝͟ᙡൣ॥٧䩩ᡫ᝭o᝱婳", num));
        }
        num3 |= A_0.ViewSetup.DisplayBackgroundShape ? 0x80 : 0;
        A_1.Write((ushort)num3);
        A_1.Write((ushort)0);
        A_1.Write((ushort)0);
        A_1.Write((uint)0);
        A_1.Write((ushort)0);
        A_1.Write((ushort)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        A_1.Write((uint)0);
        smethod_4(A_1, A_0);
        return(((int)A_1.BaseStream.Position) - position);
    }