Exemplo n.º 1
0
        protected virtual bool ModifyPropertyInfo(Type typeForDynamicProperties, DynamicModelPropertyInfo info)
        {
            SetDetaultValues(info);
            MapPropertiesToModel(typeForDynamicProperties, info);
            if (NonNullableObjects.Contains(info.Name))
            {
                info.AddAttribute(new NullValueAttribute(false));
            }
            if (typeof(BaseView).IsAssignableFrom(typeForDynamicProperties))
            {
                if (GridViewMappings.ContainsKey(info.Name))
                {
                    info.AddAttribute(new BrowsableAttribute(false));
                }
//                    info.CreateValueCalculator("((IModelListView)this.Parent.Parent)." + _gridViewMappings[info.Name]);
            }
            else if (typeof(GridColumn).IsAssignableFrom(typeForDynamicProperties))
            {
                if (ColumnMappings.ContainsKey(info.Name))
                {
                    var expressionPath = "((IModelColumn)this.Parent)." + ColumnMappings[info.Name];
                    info.CreateValueCalculator(expressionPath);
                }
                else if (ColumnPropertiesToExclude.Contains(info.Name))
                {
                    return(false);
                }
            }
            return(true);
        }
 protected override bool ModifyPropertyInfo(Type typeForDynamicProperties, DynamicModelPropertyInfo info) {
     if (typeForDynamicProperties == typeof(GridBand)) {
         if (info.Name == "Width")
             info.AddAttribute(new NullValueAttribute(false));
         return true;
     }
     return base.ModifyPropertyInfo(typeForDynamicProperties, info);
 }
        protected virtual bool ModifyPropertyInfo(Type typeForDynamicProperties, DynamicModelPropertyInfo info) {
            SetDetaultValues(info);
            MapPropertiesToModel(typeForDynamicProperties, info);
            if (_nonNullableObjects.Contains(info.Name)) {
                info.AddAttribute(new NullValueAttribute(false));
            }
            if (typeof(BaseView).IsAssignableFrom(typeForDynamicProperties)) {
                if (_gridViewMappings.ContainsKey(info.Name))
                    info.AddAttribute(new BrowsableAttribute(false));
//                    info.CreateValueCalculator("((IModelListView)this.Parent.Parent)." + _gridViewMappings[info.Name]);
            } else if (typeof(GridColumn).IsAssignableFrom(typeForDynamicProperties)) {
                if (_columnMappings.ContainsKey(info.Name)) {
                    var expressionPath = "((IModelColumn)this.Parent)." + _columnMappings[info.Name];
                    info.CreateValueCalculator(expressionPath);
                } else if (_columnPropertiesToExclude.Contains(info.Name))
                    return false;
            }
            return true;
        }
Exemplo n.º 4
0
 protected override bool ModifyPropertyInfo(Type typeForDynamicProperties, DynamicModelPropertyInfo info)
 {
     if (typeForDynamicProperties == typeof(GridBand))
     {
         if (info.Name == "Width")
         {
             info.AddAttribute(new NullValueAttribute(false));
         }
         return(true);
     }
     return(base.ModifyPropertyInfo(typeForDynamicProperties, info));
 }