Exemplo n.º 1
0
        public override Object Clone()
        {
            SCLRecord rec = new SCLRecord();

            rec.field_1_numerator   = field_1_numerator;
            rec.field_2_denominator = field_2_denominator;
            return(rec);
        }
Exemplo n.º 2
0
        public void TestLoad()
        {
            SCLRecord record = new SCLRecord(TestcaseRecordInputStream.Create((short)0xa0, data));
            Assert.AreEqual(3, record.Numerator);
            Assert.AreEqual(4, record.Denominator);


            Assert.AreEqual(8, record.RecordSize);
        }
Exemplo n.º 3
0
        public void TestStore()
        {
            SCLRecord record = new SCLRecord();
            record.Numerator = ((short)3);
            record.Denominator = ((short)4);


            byte[] recordBytes = record.Serialize();
            Assert.AreEqual(recordBytes.Length - 4, data.Length);
            for (int i = 0; i < data.Length; i++)
                Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
        }
Exemplo n.º 4
0
 private SCLRecord CreateSCLRecord(short numerator, short denominator)
 {
     SCLRecord r = new SCLRecord();
     r.Denominator = (denominator);
     r.Numerator = (numerator);
     return r;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Sets the zoom magnication for the _sheet.  The zoom is expressed as a
        /// fraction.  For example to express a zoom of 75% use 3 for the numerator
        /// and 4 for the denominator.
        /// </summary>
        /// <param name="numerator">The numerator for the zoom magnification.</param>
        /// <param name="denominator">The denominator for the zoom magnification.</param>
        public void SetZoom(int numerator, int denominator)
        {
            if (numerator < 1 || numerator > 65535)
                throw new ArgumentException("Numerator must be greater than 0 and less than 65536");
            if (denominator < 1 || denominator > 65535)
                throw new ArgumentException("Denominator must be greater than 0 and less than 65536");

            SCLRecord sclRecord = new SCLRecord();
            sclRecord.Numerator = ((short)numerator);
            sclRecord.Denominator = ((short)denominator);
            Sheet.SetSCLRecord(sclRecord);
        }
Exemplo n.º 6
0
        public override Object Clone()
        {
            SCLRecord rec = new SCLRecord();

            rec.field_1_numerator = field_1_numerator;
            rec.field_2_denominator = field_2_denominator;
            return rec;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Sets the SCL record or Creates it in the correct place if it does not
        /// already exist.
        /// </summary>
        /// <param name="sclRecord">The record to set.</param>
        public void SetSCLRecord(SCLRecord sclRecord)
        {
            int oldRecordLoc = FindFirstRecordLocBySid(SCLRecord.sid);
            if (oldRecordLoc == -1)
            {
                // Insert it after the window record
                int windowRecordLoc = FindFirstRecordLocBySid(WindowTwoRecord.sid);
                records.Insert(windowRecordLoc + 1, sclRecord);
            }
            else
            {
                records[oldRecordLoc] = sclRecord;
            }

        }