예제 #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if ((context != null) && (provider != null))
            {
                // Access the Property Browser's UI display service
                IWindowsFormsEditorService editorService =
                    (IWindowsFormsEditorService)
                    provider.GetService(typeof(IWindowsFormsEditorService));

                if (editorService != null)
                {
                    DataMappingEditorForm modalEditor = new DataMappingEditorForm();
                    modalEditor.DataMappings = (List <DataMapping>)value;
                    if (editorService.ShowDialog(modalEditor) == DialogResult.OK)
                    {
                        return(modalEditor.DataMappings);
                    }
                }
            }
            return(base.EditValue(context, provider, value));
        }
예제 #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if ((context != null) && (provider != null))
            {
                // Access the Property Browser's UI display service
                IWindowsFormsEditorService editorService =
                (IWindowsFormsEditorService)
                provider.GetService(typeof(IWindowsFormsEditorService));

                if (editorService != null)
                {
                    DataMappingEditorForm modalEditor = new DataMappingEditorForm();
                    modalEditor.DataMappings = (List<DataMapping>)value;
                    if (editorService.ShowDialog(modalEditor) == DialogResult.OK)
                    {
                        return modalEditor.DataMappings;
                    }
                }
            }
            return base.EditValue(context, provider, value);
        }