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; }
protected void AddProperty(EditablePropertyModel editableProp) { dynamicProperties[editableProp.PropertyName] = editableProp; NotifyToRefreshAllProperties(); }
private Attribute[] GetPropertyEditorAttributesFrom(EditablePropertyModel model) { if (IsExpandable(model)) return new Attribute[] { new CategoryAttribute(model.PropertyGroup), new ExpandableObjectAttribute() }; return new Attribute[] { new CategoryAttribute(model.PropertyGroup) }; }
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; }