/// <summary>
 /// Instantiates a DC values compute strategy for a specific data control. The compute
 /// strategy will use the given DC values builder to build the list.
 /// </summary>
 /// <param name="boundControlId"></param>
 /// <param name="dcValuesBuilder"></param>
 /// <param name="dcValuesRangeBuilder"></param>
 /// <param name="rangeDataSourceId"></param>
 public DataControlValuesComputeStrategy(int boundControlId, DcValuesBuilderBase dcValuesBuilder, IRangeDataBuilder dcValuesRangeBuilder, DataSourceId rangeDataSourceId)
 {
     this.dcValuesBuilder      = dcValuesBuilder;
     this.boundControlId       = boundControlId;
     this.dcValuesRangeBuilder = dcValuesRangeBuilder;
     this.rangeDataSourceId    = rangeDataSourceId;
 }
예제 #2
0
        public GatewayResult AddDataControlView(RuntimeReadOnlyView view, DcValuesBuilderBase dcValuesBuilder)
        {
            GatewayResult result = null;

            DataControlViews.Add(view);
            int boundControlId = ((DataControlSourceViewDefinition)view.DataSourceViewDefinition).BoundControlId;
            var dsId           = view.DataSourceViewDefinition.TaskDataSource.DataSourceDefinition.Id;
            var strategy       = new DataControlValuesComputeStrategy(boundControlId, dcValuesBuilder, view.RangeBuilder, dsId);
            var unitId         = RecomputeIdFactory.GetRecomputeId(typeof(DcValues), boundControlId);

            RecordComputer.Add(unitId, strategy);
            result = view.OpenDataSource();
            view.BuildCursor();

            if (result.Success)
            {
                view.Prepare();
            }

            return(result);
        }