/// <summary> /// Initializes a new instance of the <see cref="HeaderBehaviorModel"/> class. /// </summary> /// <param name="p_BehaviorResize">The behavior resize.</param> /// <param name="p_BehaviorButton">The behavior button.</param> public HeaderBehaviorModel(ResizeBehaviorModel p_BehaviorResize, ButtonBehaviorModel p_BehaviorButton) { this.resize = p_BehaviorResize; SubModels.Add(resize); SubModels.Add(p_BehaviorButton); }
/// <summary> /// Initializes a new instance of the <see cref="RowHeaderBehaviorModel"/> class. /// </summary> /// <param name="p_BehaviorResize">The behavior resize.</param> /// <param name="p_BehaviorButton">The behavior button.</param> /// <param name="p_BehaviorUnselectable">The behavior unselectable.</param> public RowHeaderBehaviorModel(ResizeBehaviorModel p_BehaviorResize, ButtonBehaviorModel p_BehaviorButton, UnselectableBehaviorModel p_BehaviorUnselectable) { resize = p_BehaviorResize; SubModels.Add(resize); SubModels.Add(p_BehaviorButton); SubModels.Add(p_BehaviorUnselectable); }
/// <summary> /// Constructor /// </summary> /// <param name="p_BehaviorResize"></param> /// <param name="p_BehaviorButton"></param> /// <param name="p_BehaviorUnselectable"></param> public RowHeader(Resize p_BehaviorResize, Button p_BehaviorButton, Unselectable p_BehaviorUnselectable) { m_Resize = p_BehaviorResize; SubModels.Add(m_Resize); SubModels.Add(p_BehaviorButton); SubModels.Add(p_BehaviorUnselectable); }
/// <summary> /// Constructor /// </summary> /// <param name="p_BehaviorResize"></param> /// <param name="p_BehaviorButton"></param> public Header(Resize p_BehaviorResize, Button p_BehaviorButton) { m_Resize = p_BehaviorResize; SubModels.Add(m_Resize); SubModels.Add(p_BehaviorButton); }
void IDecisionTree.AddSubModel(IDomainObject domainObject) { if (domainObject != null) { string model = (domainObject as IDomainObjectImpl).FullModelName; if (model != "") { SubModels.Add(domainObject, model); } } }
private Expression <Func <VehicleToDriveTypeDocument, bool> > AddSubModelsFilter(Expression <Func <VehicleToDriveTypeDocument, bool> > filterEx) { if (SubModels == null || !SubModels.Any()) { return(filterEx); } Expression <Func <VehicleToDriveTypeDocument, bool> > subModelsFilterEx = null; foreach (var subModel in SubModels) { subModelsFilterEx = subModelsFilterEx.OrElse(x => x.SubModelName == subModel); } return(filterEx.AndAlso(subModelsFilterEx)); }
/// <summary> /// Constructor /// </summary> /// <param name="p_EnableSort">True to enable sort, otherwise false.</param> /// <param name="p_RangeToSort">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_HeaderRange">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_BehaviorResize"></param> /// <param name="p_BehaviorButton"></param> /// <param name="p_BehaviorUnselectable"></param> public ColumnHeader(bool p_EnableSort, IRangeLoader p_RangeToSort, IRangeLoader p_HeaderRange, Resize p_BehaviorResize, Button p_BehaviorButton, Unselectable p_BehaviorUnselectable) { m_bEnableSort = p_EnableSort; if (p_EnableSort) { m_HeaderRange = p_HeaderRange; m_RangeToSort = p_RangeToSort; } else { m_HeaderRange = null; m_RangeToSort = null; } m_Resize = p_BehaviorResize; SubModels.Add(m_Resize); SubModels.Add(p_BehaviorButton); SubModels.Add(p_BehaviorUnselectable); }
/// <summary> /// Initializes a new instance of the <see cref="ColumnHeaderBehaviorModel"/> class. /// </summary> /// <param name="p_EnableSort">True to enable sort; otherwise <c>false</c>.</param> /// <param name="p_RangeToSort">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_HeaderRange">If null and p_EnableSort is true then the range is automatically calculated.</param> /// <param name="p_BehaviorResize">The resize behaviour.</param> /// <param name="p_BehaviorButton">The button behaviour.</param> /// <param name="p_BehaviorUnselectable">The behavior unselectable.</param> public ColumnHeaderBehaviorModel( bool p_EnableSort, IRangeLoader p_RangeToSort, IRangeLoader p_HeaderRange, ResizeBehaviorModel p_BehaviorResize, ButtonBehaviorModel p_BehaviorButton, UnselectableBehaviorModel p_BehaviorUnselectable) { doEnableSort = p_EnableSort; if (p_EnableSort == true) { headerRange = p_HeaderRange; rangeToSort = p_RangeToSort; } else { headerRange = null; rangeToSort = null; } resize = p_BehaviorResize; SubModels.Add(resize); SubModels.Add(p_BehaviorButton); SubModels.Add(p_BehaviorUnselectable); }
/// <summary> /// Add a subModel /// </summary> /// <param name="model"></param> public void AddSubModel(Model model) { SubModels.Add(model); }
/// <summary> /// Initializes a new instance of the <see cref="ResizeBehaviorModel"/> class. /// </summary> /// <param name="p_Mode">The mode.</param> public ResizeBehaviorModel(CellResizeModes p_Mode) { resizeMode = p_Mode; SubModels.Add(cursorBehaviorModel); }
/// <summary> /// Constructor /// </summary> /// <param name="p_Mode"></param> public Resize(CellResizeMode p_Mode) { m_ResizeMode = p_Mode; SubModels.Add(m_ModelCursor); }
private Expression <Func <VehicleToBodyStyleConfigDocument, bool> > AddFilter() { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > filterEx = null; if (Makes != null && Makes.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > makeFilterEx = Makes.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, make) => current.OrElse(x => x.MakeName == make)); filterEx = filterEx.AndAlso(makeFilterEx); } if (Models != null && Models.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > modelFilterEx = Models.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, model) => current.OrElse(x => x.ModelName == model)); filterEx = filterEx.AndAlso(modelFilterEx); } if (SubModels != null && SubModels.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > subModelsFilterEx = SubModels.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, subModel) => current.OrElse(x => x.SubModelName == subModel)); filterEx = filterEx.AndAlso(subModelsFilterEx); } if (StartYear != 0) { filterEx = filterEx.AndAlso(x => x.YearId >= StartYear); } if (EndYear != 0) { filterEx = filterEx.AndAlso(x => x.YearId <= EndYear); } if (Regions != null && Regions.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > regionsFilterEx = Regions.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, region) => current.OrElse(x => x.RegionName == region)); filterEx = filterEx.AndAlso(regionsFilterEx); } if (VehicleTypes != null && VehicleTypes.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > vehicleTypeFilterEx = VehicleTypes.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, vehicleType) => current.OrElse(x => x.VehicleTypeName == vehicleType)); filterEx = filterEx.AndAlso(vehicleTypeFilterEx); } if (VehicleTypeGroups != null && VehicleTypeGroups.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > vehicleTypeGroupFilterEx = VehicleTypeGroups.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, vehicleTypeGroup) => current.OrElse(x => x.VehicleTypeGroupName == vehicleTypeGroup)); filterEx = filterEx.AndAlso(vehicleTypeGroupFilterEx); } // body if (BodyNumDoors != null && BodyNumDoors.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > bodyNumDoorsFilterEx = BodyNumDoors.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, bodyNumDoor) => current.OrElse(x => x.BodyNumDoors == bodyNumDoor)); filterEx = filterEx.AndAlso(bodyNumDoorsFilterEx); } if (BodyTypes != null && BodyTypes.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > bodyTypesFilterEx = BodyTypes.Aggregate <string, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, bodyType) => current.OrElse(x => x.BodyTypeName == bodyType)); filterEx = filterEx.AndAlso(bodyTypesFilterEx); } // others if (VehicleIds != null && VehicleIds.Any()) { Expression <Func <VehicleToBodyStyleConfigDocument, bool> > vehicleIdFilterEx = VehicleIds.Aggregate <int, Expression <Func <VehicleToBodyStyleConfigDocument, bool> > >(null, (current, vehicleId) => current.OrElse(x => x.VehicleId == vehicleId)); filterEx = filterEx.AndAlso(vehicleIdFilterEx); } if (BodyStyleConfigId != 0) { filterEx = filterEx.AndAlso(x => x.BodyStyleConfigId == BodyStyleConfigId); } return(filterEx); }