Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        internal override ReturnResultBase Execute()
        {
            ReturnResultBase result = null;

            if (LocalDataviewManager.UserSorts != null)
            {
                TaskViews.ApplySort(LocalDataviewManager.UserSorts);
            }
            else
            {
                if (!KeepUserSort)
                {
                    TaskViews.ApplySort(Task.RuntimeSorts);
                }
            }

            TaskViews.ApplyUserRangesAndLocates();

            SetTaskMode();

            if (RefreshMode == ViewRefreshMode.CurrentLocation)
            {
                InitCurrentPosition();
                if (startPosition != null)
                {
                    result = ExecuteRefreshAndKeepCurrentLocation();
                    if (result.Success)
                    {
                        LocalDataviewManager.UserGatewayLocates.Clear();
                        LocalDataviewManager.UserLocates.Clear();
                        LocalDataviewManager.UserSorts = null;
                    }

                    return(result);
                }
            }

            // clean the position cache
            LocalDataviewManager.Reset();

            // Release the ViewMain cursor and re-prepare it.
            if (TaskViews.ViewMain != null)
            {
                TaskViews.ViewMain.ReleaseCursor();
                TaskViews.ViewMain.Prepare();
            }

            result = base.Execute();

            if (result.Success)
            {
                DataviewSynchronizer.SetCurrentRecordByIdx(0);
                LocalDataviewManager.UserGatewayLocates.Clear();
                LocalDataviewManager.UserLocates.Clear();
                LocalDataviewManager.UserSorts = null;
            }

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        internal override ReturnResultBase Execute()
        {
            GatewayResult result = new GatewayResult();

            if (!TaskViews.Task.isAborting() && TaskViews.ApplySort(Sorts))
            {
                localDataViewCommandViewRefresh.DataviewManager = DataviewManager;
                localDataViewCommandViewRefresh.LocalManager    = LocalManager;
                localDataViewCommandViewRefresh.Execute();
            }

            return(result);
        }
Esempio n. 3
0
 internal void BuildViewsCollection(Task task)
 {
     TaskViews = TaskViewsBuilder.BuildViewsCollection(task);
     TaskViews.ApplySort(task.RuntimeSorts);
 }