Ejemplo n.º 1
0
        private void ContinueWithQueryResult(ICrmDataSource dataSource)
        {
            AnalysisProcessing processing  = new AnalysisProcessing(this, this.currentSettings, dataSource);
            AnalysisResult     result      = processing.ComputeResult();
            IAnalysisDelegate  theDelegate = this.TheDelegate;

            this.TheDelegate = null;
            if (result.Error != null)
            {
                theDelegate.AnalysisDidFailWithError(this, result.Error);
            }
            else
            {
                theDelegate.AnalysisDidFinishWithResult(this, result);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Compute result settings request option
        /// </summary>
        /// <param name="settings">LogSettings</param>
        /// <param name="requestOption">Request option</param>
        /// <param name="theDelegate">Delegate</param>
        public void ComputeResultWithSettingsRequestOption(AnalysisExecutionSettings settings, UPRequestOption requestOption, IAnalysisDelegate theDelegate)
        {
            AnalysisExecutionContext    currentContext = this.ExecutionContext.ExecutionContext();
            AnalysisDataSourceCacheItem cacheItem      = this.dataSourceCache?.CacheItemForExecutionContext(currentContext);

            if (cacheItem != null)
            {
                this.TheDelegate     = theDelegate;
                this.currentSettings = settings;
                this.currentContext  = currentContext;
                this.ContinueWithQueryResult(cacheItem.DataSource);

                return;
            }

            this.TheDelegate     = theDelegate;
            this.currentSettings = settings;
            this.currentContext  = currentContext;
            this.currentContext.QueryResultWithRequestOptionDelegate(requestOption, this);
        }