Exemplo n.º 1
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            // create the GUI
            if (editor == null) editor = new AccountEditorControl();

            // initialize UI with current settings
            editor.AccountSettings = (AccountSettings) value;

            editService.DropDownControl(editor); // show UI
            // back from UI, save changes
            editor.AccountSettings.Save();

            return editor.AccountSettings; // return updated value (same reference as before)
        }
Exemplo n.º 2
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            // create the GUI
            if (editor == null)
            {
                editor = new AccountEditorControl();
            }

            // initialize UI with current settings
            editor.AccountSettings = (AccountSettings)value;

            editService.DropDownControl(editor); // show UI
            // back from UI, save changes
            editor.AccountSettings.Save();

            return(editor.AccountSettings); // return updated value (same reference as before)
        }