Example #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);
        }
Example #2
0
 private SCLRecord CreateSCLRecord(short numerator, short denominator)
 {
     SCLRecord r = new SCLRecord();
     r.Denominator = (denominator);
     r.Numerator = (numerator);
     return r;
 }
Example #3
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;
        }
Example #4
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 1 and less than 65536");
            if (denominator < 1 || denominator > 65535)
                throw new ArgumentException("Denominator must be greater than 1 and less than 65536");

            SCLRecord sclRecord = new SCLRecord();
            sclRecord.Numerator = ((short)numerator);
            sclRecord.Denominator = ((short)denominator);
            Sheet.SetSCLRecord(sclRecord);
        }
        /// <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;
            }

        }