/// <summary> /// builds record computer /// </summary> /// <returns></returns> internal virtual RecordComputer Build() { RecordComputer recordComputer = new RecordComputer(); recordComputer.DataviewSynchronizer = LocalDataviewManager.DataviewSynchronizer; int nextViewDataViewHeaderId = -1; int?nextLinkStartAfterField = GetNextLinkStartField(ref nextViewDataViewHeaderId); for (int i = 0; i < TaskViews.Fields.Count; i++) { if (i == nextLinkStartAfterField) { ComputeLinkStrategy computeStrategy = new ComputeLinkStrategy() { View = TaskViews.LinkViews[nextViewDataViewHeaderId] }; RecomputeId unitId = RecomputeIdFactory.GetRecomputeId(computeStrategy.View.DataviewHeader); //add computer for fetch of the links recordComputer.Add(unitId, computeStrategy); linkComputers.Add(unitId, computeStrategy); nextLinkStartAfterField = GetNextLinkStartField(ref nextViewDataViewHeaderId); } //add computer for fields AddComputeFieldStrategy(recordComputer, TaskViews.Fields[i]); } // Add the range expression computer - must be after all other computation is taken care of. AddBoundaryExpressionComputeStrategy(recordComputer, PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE, UnitComputeErrorCode.RangeFailed); return(recordComputer); }
public void Add(RecomputeId unitId, ComputeUnitStrategyBase computeUnitStrategy) { // First, any added compute unit is added to the ordered compute units list, because it should // participate in the overall record compute process. Add(computeUnitStrategy); // Secondly, add the unit to the identifiable units collection. Debug.Assert(unitId != null); identifiableStrategies[unitId] = computeUnitStrategy; }
/// <summary> /// /// </summary> /// <param name="recordComputer"></param> /// <param name="field"></param> private void AddComputeFieldStrategy(RecordComputer recordComputer, IFieldView field) { bool checkLocate = ShouldCheckLocateOnField(field); if (field.IsLink) { RecomputeId ownerLinkComputeId = RecomputeIdFactory.GetDataviewHeaderComputeId(field.DataviewHeaderId); var ownerLinkComputer = linkComputers[ownerLinkComputeId]; ownerLinkComputer.Add(CreateComputeFieldStrategy(field, checkLocate)); } else { recordComputer.Add(CreateComputeFieldStrategy(field, checkLocate)); } }
public DCValuesRecompute(Task task, int ditIndex) { control = task.getForm().getCtrl(ditIndex); unitId = RecomputeIdFactory.GetRecomputeId(control); }
/// <summary> /// Recompute a single record unit, whose id is unitId. /// </summary> /// <param name="unitId"></param> /// <param name="record"></param> internal void RecomputeUnit(RecomputeId unitId, IRecord record) { identifiableStrategies[unitId].Compute(record, false, true, true); }
/// <summary> /// a factory method that creates an dataview command /// </summary> /// <param name="taskId"></param> /// <param name="unitId"></param> /// <param name="clientRecId"></param> /// <returns></returns> internal static RecomputeUnitDataviewCommand CreateRecomputeUnitDataViewCommand(String taskId, RecomputeId unitId, int clientRecId) { return(new RecomputeUnitDataviewCommand { TaskTag = taskId, UnitId = unitId, ClientRecId = clientRecId }); }