コード例 #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc == null)
            {
                return(null);
            }

            using (FormatterSettingsForm form = new FormatterSettingsForm(value as RecordFormatterSettings))
            {
                if (edSvc.ShowDialog(form) == DialogResult.OK)
                {
                    return(form.FormatterSettings);
                }
            }

            return(value);
        }
コード例 #2
0
ファイル: UIEditors.cs プロジェクト: neeraj9/d900cdr-decoder
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            if (edSvc == null)
            {
                return null;
            }

            using (FormatterSettingsForm form = new FormatterSettingsForm(value as RecordFormatterSettings))
            {
                if (edSvc.ShowDialog(form) == DialogResult.OK)
                {
                    return form.FormatterSettings;
                }
            }

            return value;
        }