public void TestLoad() { TextRecord record = new TextRecord(TestcaseRecordInputStream.Create((short)0x1025, data)); Assert.AreEqual(TextRecord.HORIZONTAL_ALIGNMENT_CENTER, record.HorizontalAlignment); Assert.AreEqual(TextRecord.VERTICAL_ALIGNMENT_CENTER, record.VerticalAlignment); Assert.AreEqual(TextRecord.DISPLAY_MODE_TRANSPARENT, record.DisplayMode); Assert.AreEqual(0, record.RgbColor); Assert.AreEqual(-42, record.X); Assert.AreEqual(-60, record.Y); Assert.AreEqual(0, record.Width); Assert.AreEqual(0, record.Height); Assert.AreEqual(177, record.Options1); Assert.AreEqual(true, record.IsAutoColor); Assert.AreEqual(false, record.ShowKey); Assert.AreEqual(false, record.ShowValue); //Assert.AreEqual(false, record.IsVertical); Assert.AreEqual(true, record.IsAutoGeneratedText); Assert.AreEqual(true, record.IsGenerated); Assert.AreEqual(false, record.IsAutoLabelDeleted); Assert.AreEqual(true, record.IsAutoBackground); //Assert.AreEqual(TextRecord.ROTATION_NONE, record.Rotation); Assert.AreEqual(false, record.ShowCategoryLabelAsPercentage); Assert.AreEqual(false, record.ShowValueAsPercentage); Assert.AreEqual(false, record.ShowBubbleSizes); Assert.AreEqual(false, record.ShowLabel); Assert.AreEqual(77, record.IndexOfColorValue); Assert.AreEqual(11088, record.Options2); Assert.AreEqual(0, record.DataLabelPlacement); Assert.AreEqual(0, record.TextRotation); Assert.AreEqual(36, record.RecordSize); }
public override Object Clone() { TextRecord rec = new TextRecord(); rec.field_1_horizontalAlignment = field_1_horizontalAlignment; rec.field_2_verticalAlignment = field_2_verticalAlignment; rec.field_3_DisplayMode = field_3_DisplayMode; rec.field_4_rgbColor = field_4_rgbColor; rec.field_5_x = field_5_x; rec.field_6_y = field_6_y; rec.field_7_width = field_7_width; rec.field_8_height = field_8_height; rec.field_9_options1 = field_9_options1; rec.field_10_IndexOfColorValue = field_10_IndexOfColorValue; rec.field_11_options2 = field_11_options2; rec.field_12_textRotation = field_12_textRotation; return(rec); }
private TextRecord CreateUnknownTextRecord() { TextRecord r = new TextRecord(); r.HorizontalAlignment = (TextRecord.HORIZONTAL_ALIGNMENT_CENTER); r.VerticalAlignment = (TextRecord.VERTICAL_ALIGNMENT_CENTER); r.DisplayMode = (TextRecord.DISPLAY_MODE_TRANSPARENT); r.RgbColor = (0); r.X = (-37); r.Y = (-60); r.Width = (0); r.Height = (0); r.IsAutoColor = (true); r.ShowKey = (false); r.ShowValue = (false); //r.IsVertical = (false); r.IsAutoGeneratedText = (true); r.IsGenerated = (true); r.IsAutoLabelDeleted = (false); r.IsAutoBackground = (true); //r.Rotation = ((short)0); r.ShowCategoryLabelAsPercentage = (false); r.ShowValueAsPercentage = (false); r.ShowBubbleSizes = (false); r.ShowLabel = (false); r.IndexOfColorValue = ((short)77); r.DataLabelPlacement = ((short)11088); r.TextRotation = ((short)0); return r; }
public void TestStore() { TextRecord record = new TextRecord(); record.HorizontalAlignment=( TextRecord.HORIZONTAL_ALIGNMENT_CENTER ); record.VerticalAlignment=( TextRecord.VERTICAL_ALIGNMENT_CENTER ); record.DisplayMode=( TextRecord.DISPLAY_MODE_TRANSPARENT ); record.RgbColor=( 0 ); record.X=( -42 ); record.Y=( -60 ); record.Width=( 0 ); record.Height=( 0 ); record.IsAutoColor=( true ); record.ShowKey=( false ); record.ShowValue=( false ); //record.IsVertical=( false ); record.IsAutoGeneratedText=( true ); record.IsGenerated=( true ); record.IsAutoLabelDeleted=( false ); record.IsAutoBackground=( true ); //record.Rotation=( TextRecord.ROTATION_NONE ); record.ShowCategoryLabelAsPercentage=( false ); record.ShowValueAsPercentage=( false ); record.ShowBubbleSizes=( false ); record.ShowLabel=( false ); record.IndexOfColorValue=(short)77 ; record.Options2=(short)0x2b50 ; // record.DataLabelPlacement=((short)0x2b50 ); record.TextRotation=(short)0 ; 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); }
public override Object Clone() { TextRecord rec = new TextRecord(); rec.field_1_horizontalAlignment = field_1_horizontalAlignment; rec.field_2_verticalAlignment = field_2_verticalAlignment; rec.field_3_DisplayMode = field_3_DisplayMode; rec.field_4_rgbColor = field_4_rgbColor; rec.field_5_x = field_5_x; rec.field_6_y = field_6_y; rec.field_7_width = field_7_width; rec.field_8_height = field_8_height; rec.field_9_options1 = field_9_options1; rec.field_10_IndexOfColorValue = field_10_IndexOfColorValue; rec.field_11_options2 = field_11_options2; rec.field_12_textRotation = field_12_textRotation; return rec; }
private TextRecord CreateUnknownTextRecord() { TextRecord r = new TextRecord(); r.SetHorizontalAlignment( TextRecord.HORIZONTAL_ALIGNMENT_CENTER ); r.SetVerticalAlignment( TextRecord.VERTICAL_ALIGNMENT_CENTER ); r.SetDisplayMode( TextRecord.DISPLAY_MODE_TRANSPARENT ); r.SetRgbColor( 0 ); r.SetX( -37 ); r.SetY( -60 ); r.SetWidth( 0 ); r.SetHeight( 0 ); r.SetAutoColor( true ); r.SetShowKey( false ); r.SetShowValue( false ); r.SetVertical( false ); r.SetAutoGeneratedText( true ); r.SetGenerated( true ); r.SetAutoLabelDeleted( false ); r.SetAutoBackground( true ); r.SetRotation( (short) 0 ); r.SetShowCategoryLabelAsPercentage( false ); r.SetShowValueAsPercentage( false ); r.SetShowBubbleSizes( false ); r.SetShowLabel( false ); r.SetIndexOfColorValue( (short) 77 ); r.SetDataLabelPlacement( (short) 11088 ); r.SetTextRotation( (short) 0 ); return r; }