public AxisParentAggregate(RecordStream rs, ChartRecordAggregate container) : base(RuleName_AXISPARENT, container) { axisPraent = (AxisParentRecord)rs.GetNext(); rs.GetNext(); pos = (PosRecord)rs.GetNext(); if (ChartFormatRecord.sid != rs.PeekNextChartSid()) { try { axes = new AxesAggregate(rs, this); } catch { Debug.Print("not find axes rule records"); axes = null; } } Debug.Assert(ChartFormatRecord.sid == rs.PeekNextChartSid()); while (ChartFormatRecord.sid == rs.PeekNextChartSid()) { crtList.Add(new CRTAggregate(rs, this)); } Record r = rs.GetNext();//EndRecord Debug.Assert(r.GetType() == typeof(EndRecord)); }
private static AxisParentRecord CreateAxisParentRecord() { AxisParentRecord r = new AxisParentRecord(); r.AxisType = (AxisParentRecord.AXIS_TYPE_MAIN); r.X = (479); r.Y = (221); r.Width = (2995); r.Height = (2902); return(r); }
public void TestLoad() { AxisParentRecord record = new AxisParentRecord(TestcaseRecordInputStream.Create((short)0x1041, data)); Assert.AreEqual(AxisParentRecord.AXIS_TYPE_MAIN, record.AxisType); Assert.AreEqual(0x021d, record.X); Assert.AreEqual(0xdd, record.Y); Assert.AreEqual(0x0b31, record.Width); Assert.AreEqual(0x0b56, record.Height); Assert.AreEqual(22, record.RecordSize); }
public void TestStore() { AxisParentRecord record = new AxisParentRecord(); record.AxisType = (AxisParentRecord.AXIS_TYPE_MAIN); record.X = (0x021d); record.Y = (0xdd); record.Width = (0x0b31); record.Height = (0x0b56); 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); } }