public void PaintValue_Invoke_Nop() { using (var bm = new Bitmap(10, 10)) using (var graphics = Graphics.FromImage(bm)) { var editor = new UITypeEditor(); editor.PaintValue(null, graphics, Rectangle.Empty); editor.PaintValue(new PaintValueEventArgs(null, null, graphics, Rectangle.Empty)); } }
/// <summary> /// Paints a representative value of the given object to the provided /// canvas. Painting should be done within the boundaries of the /// provided rectangle. /// </summary> public override void PaintValue(PaintValueEventArgs e) { if (innerEditor != null) { innerEditor.PaintValue(e); } base.PaintValue(e); }
public void Ctor_Properties_DefaultValues() { var editor = new UITypeEditor(); using (var bm = new Bitmap(10, 10)) using (var graphics = Graphics.FromImage(bm)) { Assert.False(editor.IsDropDownResizable); Assert.Equal(graphics, editor.EditValue(null, graphics)); Assert.Equal(graphics, editor.EditValue(null, null, graphics)); Assert.Equal(UITypeEditorEditStyle.None, editor.GetEditStyle()); Assert.Equal(UITypeEditorEditStyle.None, editor.GetEditStyle(null)); Assert.False(editor.GetPaintValueSupported()); Assert.False(editor.GetPaintValueSupported(null)); // nop editor.PaintValue(bm, graphics, Rectangle.Empty); } }