コード例 #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (editorService != null)
                {
                    if (_dropDownEditorPropertyEditorControl == null) _dropDownEditorPropertyEditorControl = new DropDownEditorPropertyEditorControl();
                    _dropDownEditorPropertyEditorControl.Start(editorService, value);
                    editorService.DropDownControl(_dropDownEditorPropertyEditorControl);

                    return new DropDownEditorProperty(_dropDownEditorPropertyEditorControl.SampleStringTextBox.Text, _dropDownEditorPropertyEditorControl.SampleBooleanCheckBox.Checked);
                }
            }

            return value;
        }
コード例 #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                _editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (_editorService != null)
                {
                    if (_dropDownEditorPropertyEditorControl == null)
                    {
                        _dropDownEditorPropertyEditorControl = new DropDownEditorPropertyEditorControl();
                    }
                    _dropDownEditorPropertyEditorControl.Start(_editorService, value);
                    _editorService.DropDownControl(_dropDownEditorPropertyEditorControl);

                    return(new DropDownEditorProperty(_dropDownEditorPropertyEditorControl.SampleStringTextBox.Text, _dropDownEditorPropertyEditorControl.SampleBooleanCheckBox.Checked));
                }
            }

            return(value);
        }