Ejemplo n.º 1
0
        /**
         * Constructs a Style record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public StyleRecord(RecordInputStream in1)
        {
            fHighByte = BitFieldFactory.GetInstance(0x01); //have to init here, since we are being called
            //from base, and class level init hasnt been done. 
            field_1_xf_index = in1.ReadShort();
            if (Type == STYLE_BUILT_IN)
            {
                field_2_builtin_style = (byte)in1.ReadByte();
                field_3_outline_style_level = (byte)in1.ReadByte();
            }
            else if (Type == STYLE_USER_DEFINED)
            {
                field_2_name_length = in1.ReadShort();

                // Some files from Crystal Reports lack
                //  the remaining fields, which Is naughty
                if (in1.Remaining > 0)
                {
                    field_3_string_options = (byte)in1.ReadByte();

                    byte[] str = in1.ReadRemainder();
                    if (fHighByte.IsSet(field_3_string_options))
                    {
                        field_4_name = StringUtil.GetFromUnicodeBE(str, 0, field_2_name_length);
                    }
                    else
                    {
                        field_4_name = StringUtil.GetFromCompressedUnicode(str, 0, field_2_name_length);
                    }
                }
            }

            // todo sanity Check exception to make sure we're one or the other
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the instance.
 /// </summary>
 /// <param name="mask">The mask.</param>
 /// <returns></returns>
 public static BitField GetInstance(int mask)
 {
     BitField f = (BitField)instances[mask];
     if (f == null)
     {
         f = new BitField(mask);
         instances[mask] = f;
     }
     return f;
 }
Ejemplo n.º 3
0
 private void SetOptionFlag(bool flag, BitField field)
 {
     field_5_options = field.SetBoolean(field_5_options, flag);
 }
Ejemplo n.º 4
0
 private bool GetOptionFlag(BitField field)
 {
     return field.IsSet(field_5_options);
 }
Ejemplo n.º 5
0
 private void SetModified(bool modified, BitField field)
 {
     field_5_options = field.SetBoolean(field_5_options, !modified);
 }
Ejemplo n.º 6
0
 private bool IsModified(BitField field)
 {
     return !field.IsSet(field_5_options);
 }
Ejemplo n.º 7
0
 private void SetOptionFlag(bool modified, BitField field)
 {
     int value = modified ? 0 : 1;
     int optionFlags = GetInt(OFFSET_OPTION_FLAGS);
     optionFlags = field.SetValue(optionFlags, value);
     SetInt(OFFSET_OPTION_FLAGS, optionFlags);
 }
Ejemplo n.º 8
0
 private bool GetOptionFlag(BitField field)
 {
     int optionFlags = GetInt(OFFSET_OPTION_FLAGS);
     int value = field.GetValue(optionFlags);
     return value == 0 ? true : false;
 }
Ejemplo n.º 9
0
 private bool GetFontOption(BitField field)
 {
     int options = GetInt(OFFSET_FONT_OPTIONS);
     return field.IsSet(options);
 }
Ejemplo n.º 10
0
 private void SetFontOption(bool option, BitField field)
 {
     int options = GetInt(OFFSET_FONT_OPTIONS);
     options = field.SetBoolean(options, option);
     SetInt(OFFSET_FONT_OPTIONS, options);
 }
Ejemplo n.º 11
0
 internal SysIndexProcedure(int mask)
 {
     this.mask = new BitField(mask);
 }
Ejemplo n.º 12
0
 public void TestSetLargeValues()
 {
     BitField bf1 = new BitField(0xF), bf2 = new BitField(0xF0000000);
     int a = 0;
     a = bf1.SetValue(a, 9);
     a = bf2.SetValue(a, 9);
     Assert.AreEqual(9, bf1.GetValue(a));
     Assert.AreEqual(9, bf2.GetValue(a));
 }