protected ContainerModelDecorator(IContainerModel container) : base(container) { _container = container; MaxItems = container.MaxItems; Children = container.Children; Properties = container.Properties; }
public TableContainerModel(IContainerModel container) : base(container) { ShowFilters = true; Filters = new Dictionary <string, NameValueModel>(); PropertyLists = new Dictionary <string, IContainerModel>(); ContainerType = Code.Enums.ContainerType.Table; }
private IContainerModel _UpdateContainer(IContainerModel model) { _updateContainerFuncMap[model.Type](model); if (!model.Children.IsNullOrEmpty()) { var childList = new List <IModel>(); foreach (var child in model.Children) { childList.Add(_updateFuncMap[child.Type](child)); } model.Children = childList; } return(model); }
public static IModel BuildContainer(IContainerModel container) { Type type = container.Model.GetType(); PropertyInfo[] properties = type.GetProperties().Where(p => !_excludeProps.Contains(p.Name)).ToArray(); foreach (PropertyInfo property in properties.Where(p => !_excludeProps.Contains(p.Name))) { var propType = property.PropertyType; if (typeof(IEnumerable <IModel>).IsAssignableFrom(propType)) { } else if (typeof(IModel).IsAssignableFrom(propType)) { //_AddOrUpdateProperty(container.Properties, property.Name, new ModelProperty() //{ // Type = PropertyDataType.List, // Name = property.Name //}); } else { _AddOrUpdateProperty(container.Properties, property.Name, new ModelProperty() { Name = property.Name, Type = _GetPropertyDataType(propType), Value = property.GetValue(container.Model) }); } } container.Initialize(); return(container); }
/// <summary> /// Constructor /// </summary> /// <param name="containerModel"></param> public ContainerRegionModel(IContainerModel containerModel) : base(containerModel.Name) { this.containerModel = containerModel; }
public ListContainerModel(IContainerModel container) : base(container) { ContainerType = Code.Enums.ContainerType.List; }