예제 #1
0
        internal int method_247(FormField A_0, Spire.Doc.Documents.FormFieldType A_1)
        {
            int num = 8;

            switch (A_1)
            {
            case Spire.Doc.Documents.FormFieldType.TextInput:
                return(0);

            case Spire.Doc.Documents.FormFieldType.CheckBox:
                if ((A_0 as CheckBoxFormField).Checked)
                {
                    return(1);
                }
                return(0);

            case Spire.Doc.Documents.FormFieldType.DropDown:
                return((A_0 as DropDownFormField).DropDownSelectedIndex);
            }
            throw new InvalidOperationException(BookmarkStart.b("笭帯失娳夵伷吹᰻堽⼿ぁ⥃晅⹇⍉⥋≍㑏牑⁓⽕⡗㽙牛", num));
        }
예제 #2
0
        private void method_246(FormField A_0, Spire.Doc.Documents.FormFieldType A_1, BinaryWriter A_2)
        {
            string str;
            int    num = 5;

            A_2.Write(uint.MaxValue);
            int num2 = 0;

            num2  = (int)(Spire.Doc.Documents.FormFieldType.TextInput | A_1);
            num2 |= this.method_247(A_0, A_1) << 2;
            num2 |= A_0.OwnHelpText ? 0x80 : 0;
            num2 |= A_0.OwnStatusText ? 0x100 : 0;
            num2 |= !A_0.Enabled ? 0x200 : 0;
            if (A_1 == Spire.Doc.Documents.FormFieldType.CheckBox)
            {
                num2 |= ((A_0 as CheckBoxFormField).SizeType != CheckBoxSizeType.Auto) ? 0x400 : 0;
            }
            if (A_1 == Spire.Doc.Documents.FormFieldType.TextInput)
            {
                num2 |= ((int)(A_0 as TextFormField).TextFieldType) << 11;
            }
            num2 |= A_0.CalculateOnExit ? 0x4000 : 0;
            num2 |= (A_1 == Spire.Doc.Documents.FormFieldType.DropDown) ? 0x8000 : 0;
            A_2.Write((ushort)num2);
            int num3 = (A_0 is TextFormField) ? (A_0 as TextFormField).MaximumLength : 0;
            int num4 = (A_0 is CheckBoxFormField) ? ((int)((A_0 as CheckBoxFormField).CheckBoxSize * 2f)) : 20;

            A_2.Write((ushort)num3);
            A_2.Write((ushort)num4);
            Class1029.smethod_2(A_0.Name, 20, A_2, true, true);
            switch (A_1)
            {
            case Spire.Doc.Documents.FormFieldType.TextInput:
            {
                TextFormField field = A_0 as TextFormField;
                switch (field.TextFieldType)
                {
                case TextFormFieldType.RegularText:
                case TextFormFieldType.NumberText:
                case TextFormFieldType.DateText:
                case TextFormFieldType.Calculation:
                    Class1029.smethod_2(field.DefaultText, 0xff, A_2, true, true);
                    goto Label_01CB;

                case TextFormFieldType.CurrentDate:
                case TextFormFieldType.CurrentTime:
                    Class1029.smethod_2("", 0xff, A_2, true, true);
                    goto Label_01CB;
                }
                throw new InvalidOperationException(BookmarkStart.b("縪䌬䐮弰尲䈴夶ᤸ伺堼䜾㕀捂ⱄ⥆㥈㹊㥌潎═⩒╔㉖睘", num));
            }

            case Spire.Doc.Documents.FormFieldType.CheckBox:
                A_2.Write((A_0 as CheckBoxFormField).DefaultCheckBoxValue ? ((ushort)1) : ((ushort)0));
                break;

            case Spire.Doc.Documents.FormFieldType.DropDown:
                A_2.Write((ushort)(A_0 as DropDownFormField).DefaultDropDownValue);
                break;

            default:
                throw new InvalidOperationException(BookmarkStart.b("縪䌬䐮弰尲䈴夶ᤸ崺刼䴾ⱀ捂⍄⹆ⱈ❊⥌潎═⩒╔㉖睘", num));
            }
Label_01CB:
            str = (A_0 is TextFormField) ? (A_0 as TextFormField).StringFormat : "";
            Class1029.smethod_2(str, 0x40, A_2, true, true);
            Class1029.smethod_2(A_0.Help, 0xff, A_2, true, true);
            Class1029.smethod_2(A_0.StatusBarHelp, 0x8a, A_2, true, true);
            Class1029.smethod_2(A_0.MacroOnStart, 0x20, A_2, true, true);
            Class1029.smethod_2(A_0.MacroOnEnd, 0x20, A_2, true, true);
            if (A_1 == Spire.Doc.Documents.FormFieldType.DropDown)
            {
                A_2.Write((ushort)0xffff);
                A_2.Write((uint)(A_0 as DropDownFormField).DropDownItems.Count);
                for (int i = 0; i < (A_0 as DropDownFormField).DropDownItems.Count; i++)
                {
                    Class1029.smethod_2((A_0 as DropDownFormField).DropDownItems[i].Text, 0x7fffffff, A_2, true, false);
                }
            }
        }
예제 #3
0
        private void method_243(BinaryReader A_0)
        {
            bool flag;
            int  num = 3;

            if (!(flag = A_0.ReadUInt32() == uint.MaxValue))
            {
                A_0.BaseStream.Seek(-4L, SeekOrigin.Current);
            }
            int num4 = A_0.ReadUInt16();

            Spire.Doc.Documents.FormFieldType type = ((Spire.Doc.Documents.FormFieldType)num4) & (Spire.Doc.Documents.FormFieldType.DropDown | Spire.Doc.Documents.FormFieldType.CheckBox);
            int num3 = (num4 & 0x7c) >> 2;

            switch (type)
            {
            case Spire.Doc.Documents.FormFieldType.CheckBox:
                if (num3 != 0x19)
                {
                    (this as CheckBoxFormField).Checked = num3 != 0;
                }
                break;

            case Spire.Doc.Documents.FormFieldType.DropDown:
                if (num3 != 0x19)
                {
                    (this as DropDownFormField).DropDownSelectedIndex = num3;
                }
                break;
            }
            this.OwnHelpText     = (num4 & 0x80) != 0;
            this.OwnStatusText   = (num4 & 0x100) != 0;
            this.Enabled         = (num4 & 0x200) == 0;
            this.CalculateOnExit = (num4 & 0x4000) != 0;
            if (this is CheckBoxFormField)
            {
                (this as CheckBoxFormField).SizeType = ((num4 & 0x400) == 0) ? CheckBoxSizeType.Auto : CheckBoxSizeType.Exactly;
            }
            bool flag2 = (num4 & 0x8000) != 0;
            int  num8  = A_0.ReadUInt16();
            int  num7  = A_0.ReadUInt16();

            if (this is TextFormField)
            {
                (this as TextFormField).TextFieldType = (TextFormFieldType)((num4 & 0x3800) >> 11);
                (this as TextFormField).MaximumLength = num8;
            }
            if (this is CheckBoxFormField)
            {
                (this as CheckBoxFormField).CheckBoxSize = num7;
            }
            if (!flag)
            {
                A_0.ReadUInt16();
            }
            this.Name = Class1029.smethod_1(A_0, flag, true);
            switch (type)
            {
            case Spire.Doc.Documents.FormFieldType.TextInput:
            {
                string str2 = Class1029.smethod_1(A_0, flag, true);
                if (num3 != 0x19)
                {
                    (this as TextFormField).DefaultText = str2;
                }
                break;
            }

            case Spire.Doc.Documents.FormFieldType.CheckBox:
                (this as CheckBoxFormField).DefaultCheckBoxValue = A_0.ReadUInt16() != 0;
                break;

            case Spire.Doc.Documents.FormFieldType.DropDown:
                (this as DropDownFormField).DefaultDropDownValue = A_0.ReadUInt16();
                break;

            default:
                throw new InvalidOperationException(BookmarkStart.b("簨䔪䘬䄮帰䐲嬴᜶弸吺似刾慀╂ⱄ≆╈⽊浌㭎⡐⍒ご祖", num));
            }
            string str = Class1029.smethod_1(A_0, flag, true);

            if (this is TextFormField)
            {
                (this as TextFormField).StringFormat = str;
            }
            this.Help          = Class1029.smethod_1(A_0, flag, true);
            this.StatusBarHelp = Class1029.smethod_1(A_0, flag, true);
            this.MacroOnStart  = Class1029.smethod_1(A_0, flag, true);
            this.MacroOnEnd    = Class1029.smethod_1(A_0, flag, true);
            if ((type == Spire.Doc.Documents.FormFieldType.DropDown) && flag2)
            {
                int num5;
                A_0.ReadInt16();
                if (!flag)
                {
                    num5 = A_0.ReadInt16();
                    A_0.ReadInt16();
                    A_0.ReadInt16();
                    A_0.ReadInt16();
                    A_0.ReadBytes(num5 * 2);
                }
                else
                {
                    num5 = A_0.ReadInt32();
                }
                if (this is DropDownFormField)
                {
                    for (int i = 0; i < num5; i++)
                    {
                        (this as DropDownFormField).DropDownItems.Add(Class1029.smethod_1(A_0, flag, false));
                    }
                }
            }
        }