예제 #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService = null;

            if (context != null && context.Instance != null && provider != null)
            {
                editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (editorService != null)
                {
                    MyListControl      control       = (MyListControl)context.Instance;
                    ScopeEditorControl editorControl = new ScopeEditorControl(control.Scope);
                    editorService.DropDownControl(editorControl);
                    value = editorControl.Scope;
                    return(value);
                }
            }

            return(value);
        }
예제 #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService = null;

            if (context != null && context.Instance != null && provider != null)
            {
                editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (editorService != null)
                {
                    MyListControl     control = (MyListControl)context.Instance;
                    ScopeEditorDialog dlg     = new ScopeEditorDialog(control.Scope);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        value = dlg.Scope;
                        return(value);
                    }
                }
            }

            return(value);
        }