Exemplo n.º 1
0
 public PhonemeAtomCategoryWindow(object ListObject)
 {
     InitializeComponent();
     this.DialogResult = DialogResult.Cancel;
     if (ListObject.GetType() == typeof(PhonemeEditorModel))
     {
         pmodel         = ((PhonemeEditorModel)ListObject);
         this.ListValue = pmodel.Plist;
     }
     else
     {
         this.ListValue = new List <NoteAtomObject>();
     }
 }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

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

            PhonemeAtomCategoryWindow form = new PhonemeAtomCategoryWindow(value);

            if (service.ShowDialog(form) == DialogResult.OK)
            {
                PhonemeEditorModel pmodel = (PhonemeEditorModel)value;
                pmodel.Plist = form.ListValue;
                return(pmodel);
            }

            return(value);
        }