public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
            if (provider != null)
            {
                try
                {
                    using (XsdElementPickerForm form = new XsdElementPickerForm(provider))
                    {
                        IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                        if (editorService != null)
                        {
                            VSShellHelper.SetWaitCursor(provider);
                            if (editorService.ShowDialog(form) == DialogResult.OK)
                            {
                                value = form.XsdElementUri;
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    VSShellHelper.ShowErrorDialog(provider, LogEntry.ErrorMessageToString(e));
                }
            }
			return value;
		}
예제 #2
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (provider != null)
     {
         try
         {
             using (XsdElementPickerForm form = new XsdElementPickerForm(provider))
             {
                 IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                 if (editorService != null)
                 {
                     VSShellHelper.SetWaitCursor(provider);
                     if (editorService.ShowDialog(form) == DialogResult.OK)
                     {
                         value = form.XsdElementUri;
                     }
                 }
             }
         }
         catch (Exception e)
         {
             VSShellHelper.ShowErrorDialog(provider, LogEntry.ErrorMessageToString(e));
         }
     }
     return(value);
 }