Example #1
0
        /**
         * called by the class that Is responsible for writing this sucker.
         * Subclasses should implement this so that their data Is passed back in a
         * byte array.
         *
         * @param offset to begin writing at
         * @param data byte array containing instance data
         * @return number of bytes written
         */
        public override void Serialize(ILittleEndianOutput out1)
        {
            int formula1Len = GetFormulaSize(field_17_formula1);
            int formula2Len = GetFormulaSize(field_18_formula2);

            out1.WriteByte(field_1_condition_type);
            out1.WriteByte(field_2_comparison_operator);
            out1.WriteShort(formula1Len);
            out1.WriteShort(formula2Len);
            out1.WriteInt(field_5_options);
            out1.WriteShort(field_6_not_used);

            if (ContainsFontFormattingBlock)
            {
                byte[] fontFormattingRawRecord = _fontFormatting.GetRawRecord();
                out1.Write(fontFormattingRawRecord);
            }

            if (ContainsBorderFormattingBlock)
            {
                _borderFormatting.Serialize(out1);
            }

            if (ContainsPatternFormattingBlock)
            {
                _patternFormatting.Serialize(out1);
            }

            field_17_formula1.SerializeTokens(out1);
            field_18_formula2.SerializeTokens(out1);
        }
Example #2
0
        /**
         * called by the class that Is responsible for writing this sucker.
         * Subclasses should implement this so that their data Is passed back in a
         * @param offset to begin writing at
         * @param data byte array containing instance data
         * @return number of bytes written
         */

        protected override void Serialize(ContinuableRecordOutput out1)
        {
            int field_7_length_custom_menu      = field_14_custom_menu_text.Length;
            int field_8_length_description_text = field_15_description_text.Length;
            int field_9_length_help_topic_text  = field_16_help_topic_text.Length;
            int field_10_length_status_bar_text = field_17_status_bar_text.Length;

            //int rawNameSize = NameRawSize;

            // size defined below
            out1.WriteShort(OptionFlag);
            out1.WriteByte(KeyboardShortcut);
            out1.WriteByte(NameTextLength);
            // Note - formula size is not immediately before encoded formula, and does not include any array constant data
            out1.WriteShort(field_13_name_definition.EncodedTokenSize);
            out1.WriteShort(field_5_externSheetIndex_plus1);
            out1.WriteShort(field_6_sheetNumber);
            out1.WriteByte(field_7_length_custom_menu);
            out1.WriteByte(field_8_length_description_text);
            out1.WriteByte(field_9_length_help_topic_text);
            out1.WriteByte(field_10_length_status_bar_text);
            out1.WriteByte(field_11_nameIsMultibyte ? 1 : 0);

            if (IsBuiltInName)
            {
                out1.WriteByte(field_12_built_in_code);
            }
            else
            {
                string nameText = field_12_name_text;
                if (field_11_nameIsMultibyte)
                {
                    StringUtil.PutUnicodeLE(nameText, out1);
                }
                else
                {
                    StringUtil.PutCompressedUnicode(nameText, out1);
                }
            }
            field_13_name_definition.SerializeTokens(out1);
            field_13_name_definition.SerializeArrayConstantData(out1);

            StringUtil.PutCompressedUnicode(CustomMenuText, out1);
            StringUtil.PutCompressedUnicode(DescriptionText, out1);
            StringUtil.PutCompressedUnicode(HelpTopicText, out1);
            StringUtil.PutCompressedUnicode(StatusBarText, out1);
        }
Example #3
0
        public override void Serialize(ILittleEndianOutput out1)
        {
            out1.WriteInt(_option_flags);

            SerializeUnicodeString(_promptTitle, out1);
            SerializeUnicodeString(_errorTitle, out1);
            SerializeUnicodeString(_promptText, out1);
            SerializeUnicodeString(_errorText, out1);
            out1.WriteShort(_formula1.EncodedTokenSize);
            out1.WriteShort(_not_used_1);
            _formula1.SerializeTokens(out1);

            out1.WriteShort(_formula2.EncodedTokenSize);
            out1.WriteShort(_not_used_2);
            _formula2.SerializeTokens(out1);

            _regions.Serialize(out1);
        }