コード例 #1
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context != null && context.Instance != null && provider != null)
     {
         IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
         if (edSvc != null)
         {
             HtmlMenu menu = context.Instance as HtmlMenu;
             if (menu != null)
             {
                 DlgMenuItems dlg = new DlgMenuItems();
                 dlg.LoadData(menu);
                 if (edSvc.ShowDialog(dlg) == DialogResult.OK)
                 {
                     IDevClass dc = menu.GetDevClass();
                     if (dc != null)
                     {
                         dc.NotifyChange(menu, context.PropertyDescriptor.Name);
                     }
                     Form f = menu.FindForm();
                     if (f != null)
                     {
                         f.Refresh();
                     }
                 }
             }
         }
     }
     return(value);
 }