/// <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);
        }
Exemple #2
0
        /// <summary>
        /// builds record computer
        /// </summary>
        /// <returns></returns>
        internal override RecordComputer Build()
        {
            RecordComputer recordComputer = base.Build();

            recordComputer.Add(new IncrementalLocateComputeStrategy(fieldView, incrementalLocateString));

            return(recordComputer);
        }
Exemple #3
0
        /// <summary>
        /// builds record computer
        /// </summary>
        /// <returns></returns>
        internal override RecordComputer Build()
        {
            RecordComputer recordComputer = base.Build();

            AddBoundaryExpressionComputeStrategy(recordComputer, PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE, UnitComputeErrorCode.LocateFailed);

            return(recordComputer);
        }
        /// <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));
            }
        }
        protected void AddBoundaryExpressionComputeStrategy(RecordComputer recordComputer, int boundaryPropertyId, UnitComputeErrorCode computeFailureCode)
        {
            var task = TaskViews.Task;

            if (task.checkIfExistProp(boundaryPropertyId))
            {
                Property prop       = task.getProp(boundaryPropertyId);
                int      expId      = prop.GetExpressionId();
                var      expression = task.getExpById(expId);
                if (expression != null)
                {
                    recordComputer.Add(new ComputeBoundaryExpressionStrategy(expression)
                    {
                        FailureCode = computeFailureCode
                    });
                }
            }
        }