日期:2014-05-17 浏览次数:21263 次
public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
// 编辑属性值时,在右侧显示...更多按钮
return UITypeEditorEditStyle.Modal;
}
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value)
{
var edSvc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
if (edSvc != null)
{
QueryParam box = new QueryParam((List<ParameterList>)value);
edSvc.ShowDialog(box);
value = box.Parameter;
}
return base.EditValue(context, provider, value);
}
//
List<ParameterList> list = value;
list.Add(...);
value = list; // 引用没有改变,不会触发
return value;
//
List<ParameterList> list = value;
list.Add(...);
value = new List<ParameterList>(list) // 改变引用
return value;