예제 #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;
 }