Beispiel #1
0
 // Methods
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     IWindowsFormsEditorService editor_service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
     if (editor_service == null)
     {
         return base.EditValue(context, provider, RuntimeHelpers.GetObjectValue(value));
     }
     DashStyle line_style = (DashStyle)value;
     LineStyleListBox editor_control = new LineStyleListBox(line_style, editor_service);
     editor_service.DropDownControl(editor_control);
     return (DashStyle)editor_control.SelectedIndex;
 }
Beispiel #2
0
        // Methods
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editor_service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (editor_service == null)
            {
                return(base.EditValue(context, provider, RuntimeHelpers.GetObjectValue(value)));
            }
            DashStyle        line_style     = (DashStyle)value;
            LineStyleListBox editor_control = new LineStyleListBox(line_style, editor_service);

            editor_service.DropDownControl(editor_control);
            return((DashStyle)editor_control.SelectedIndex);
        }