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 out the stream to write to
         */
        public override void Serialize(ILittleEndianOutput out1)
        {
            futureHeader.Serialize(out1);

            int formula1Len = GetFormulaSize(Formula1);
            int formula2Len = GetFormulaSize(Formula2);

            out1.WriteByte(ConditionType);
            out1.WriteByte(ComparisonOperation);
            out1.WriteShort(formula1Len);
            out1.WriteShort(formula2Len);

            // TODO Update ext_formatting_length
            if (ext_formatting_length == 0)
            {
                out1.WriteInt(0);
                out1.WriteShort(0);
            }
            else
            {
                out1.WriteInt(ext_formatting_length);
                SerializeFormattingBlock(out1);
                out1.Write(ext_formatting_data);
            }

            Formula1.SerializeTokens(out1);
            Formula2.SerializeTokens(out1);
            out1.WriteShort(GetFormulaSize(formula_scale));
            formula_scale.SerializeTokens(out1);

            out1.WriteByte(ext_opts);
            out1.WriteShort(priority);
            out1.WriteShort(template_type);
            out1.WriteByte(template_param_length);
            out1.Write(template_params);

            byte type = ConditionType;

            if (type == CONDITION_TYPE_COLOR_SCALE)
            {
                color_gradient.Serialize(out1);
            }
            else if (type == CONDITION_TYPE_DATA_BAR)
            {
                data_bar.Serialize(out1);
            }
            else if (type == CONDITION_TYPE_FILTER)
            {
                out1.Write(filter_data);
            }
            else if (type == CONDITION_TYPE_ICON_SET)
            {
                multistate.Serialize(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
         * byte array.
         *
         * @param out the stream to write to
         */
        public override void Serialize(ILittleEndianOutput out1)
        {
            int formula1Len = GetFormulaSize(Formula1);
            int formula2Len = GetFormulaSize(Formula2);

            out1.WriteByte(ConditionType);
            out1.WriteByte(ComparisonOperation);
            out1.WriteShort(formula1Len);
            out1.WriteShort(formula2Len);

            SerializeFormattingBlock(out1);

            Formula1.SerializeTokens(out1);
            Formula2.SerializeTokens(out1);
        }