[]
对象设计器
public class ObjectDesigner
对象设计器
public ObjectDesigner()
编辑的对象
public object Obj { get; set; }
| 类型 | 描述 |
|---|---|
| object |
控制属性的动态隐藏
public virtual bool GetDesignerPropertyVisible(string propertyName, IBuilderContextBase contextBase)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | propertyName | 属性名 |
| IBuilderContextBase | contextBase | 上下文信息 |
| 类型 | 描述 |
|---|---|
| bool | 是否可见 |
获取属性对应的属性编辑器。
public virtual EditorSetting GetEditorSetting(PropertyDescriptor property, IBuilderContextBase contextBase)
| 类型 | 名称 | 描述 |
|---|---|---|
| System.ComponentModel.PropertyDescriptor | property | 属性信息 |
| IBuilderContextBase | contextBase | 上下文信息 |
| 类型 | 描述 |
|---|---|
| EditorSetting | 属性编辑器。 |
public class MyObjectDesigner : ObjectDesigner
{
public override EditorSetting GetEditorSetting(PropertyDescriptor property, IBuilderContextBase contextBase)
{
if(property.Name == "Text")
{
return new TextEditorSetting();
}
}
}
属性值被编辑时会被调用的回调函数
public virtual void OnPropertyEditorChanged(string propertyName, object propertyValue, Dictionary<string, IEditorSettingsDataContext> properties)
| 类型 | 名称 | 描述 |
|---|---|---|
| string | propertyName | 属性名 |
| object | propertyValue | 属性值 |
| System.Collections.Generic.Dictionary<TKey, TValue><string, IEditorSettingsDataContext> | properties | 全部属性 |
自定义校验逻辑
public virtual string Validate()
| 类型 | 描述 |
|---|---|
| string | 返回空表示校验成功,否则表示校验失败,返回错误信息 |