示例#1
0
 private bool IsExpandable(EditablePropertyModel model)
 {
     if (model.DataType.IsPrimitive)
         return false;
     if (model.DataType == typeof(string))
         return false;
     if (model.DataType.IsEnum)
         return false;
     if (model.DataType == typeof(DateTime))
         return false;
     return true;
 }
示例#2
0
 protected void AddProperty(EditablePropertyModel editableProp)
 {
     dynamicProperties[editableProp.PropertyName] = editableProp;
     NotifyToRefreshAllProperties();
 }
示例#3
0
 private Attribute[] GetPropertyEditorAttributesFrom(EditablePropertyModel model)
 {
     if (IsExpandable(model))
         return new Attribute[] { new CategoryAttribute(model.PropertyGroup), new ExpandableObjectAttribute() };
     return new Attribute[] { new CategoryAttribute(model.PropertyGroup) };
 }
示例#4
0
 public override bool TrySetMember(SetMemberBinder binder, object value)
 {
     var memberName = binder.Name;
     var model = new EditablePropertyModel()
     {
         Data = value,
         DataType = binder.ReturnType,
         PropertyName = memberName,
         PropertyGroup = ActorPropertyEditorDefaultValues.DefaultGroupName
     };
     AddProperty(model);
     return true;
 }