Пример #1
0
        public void GetPaintValueSupported_Invoke_ReturnsFalse()
        {
            var editor = new UITypeEditor();

            Assert.False(editor.GetPaintValueSupported());
            Assert.False(editor.GetPaintValueSupported(null));
        }
 /// <summary>
 ///  Determines if this editor supports the painting of a representation
 ///  of an object's value.
 /// </summary>
 public override bool GetPaintValueSupported(ITypeDescriptorContext context)
 {
     if (innerEditor != null)
     {
         return(innerEditor.GetPaintValueSupported(context));
     }
     return(base.GetPaintValueSupported(context));
 }
Пример #3
0
        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);
                }
        }