Beispiel #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dIConnection"></param>
        /// <param name="dIQueries"></param>
        /// <param name="pref"></param>
        /// <param name="stockFolderPath"></param>
        public DIWizard(DIConnection dIConnection, DIQueries dIQueries, ref UserPreference pref,string stockFolderPath)
        {
            // -- Set DAL connection object
            this.DbConnection = dIConnection;

            // -- Set DAL query object
            this.DbQueries = dIQueries;

            // -- Set the user preference object
            this._UserPreference = pref;

            // -- Create the instance of panel collection
            this._DIWizardPanels = new DIWizardPanels();

            // -- Intialize the panels.
            this.IntializePanel();

            // -- Intialize the navigation history property.
            this._NavigationHistory = new List<string>();

            // -- Intialize the selection order history.
            this.SelectionOrder = new List<string>();

            this.StockFolderPath = stockFolderPath;

            //-- Create the selection list.
            this.BuildSelectionList();

            //-- Create the selection count list.
            this.BuildSelectionCountList();

            if (!Directory.Exists(Path.Combine(this.StockFolderPath, Constants.CACHE)))
            {
                // -- Create the directory, if not exists
                Directory.CreateDirectory(Path.Combine(this.StockFolderPath, Constants.CACHE));
            }

            // -- Create the database cache folder.
            this.CreateDbFolder();

            // -- check for the existence of Diwizard.xml
            if (!File.Exists(Path.Combine(this.DbNamePath, Constants.DB_CACHE_FILENAME)))
            {
                // -- If not found create the file
                this.SaveRecordCount();
            }
            else
            {
                // -- If found, retrieve the record
                this.AvailableNIdCache = CacheInfo.Load(Path.Combine(this.DbNamePath, Constants.DB_CACHE_FILENAME));
                if (this.AvailableNIdCache == null)
                {
                    this.AvailableNIdCache = new CacheInfo();
                    // -- If the file is not properly saved.
                    this.SaveRecordCount();
                }
            }

            //if (File.Exists(Path.Combine(this.DbNamePath, Constants.DB_CACHE_FILENAME)))
            //{
            //    //-- get the avialabel NIds
            //    this.GetAvailableRecords(Path.Combine(this.DbNamePath, Constants.DB_CACHE_FILENAME));
            //}
        }
Beispiel #2
0
        /// <summary>
        /// Reset the history and user selection.
        /// </summary>
        public void Reset()
        {
            // -- Reset the history of navigation.
            this._NavigationHistory = new List<string>();

            // -- Reset the selection order.
            this.SelectionOrder = new List<string>();

            // -- Reset the selections.
            this._UserPreference.UserSelection.Reset();
            this._UserPreference.UserSelection.DataViewFilters.MostRecentData = true;

            //-- Create the selection list.
            this.BuildSelectionList();

            //-- Create the selection count list.
            this.BuildSelectionCountList();

            // -- Create the instance of panel collection
            this._DIWizardPanels = new DIWizardPanels();

            // -- Intialize the panels.
            this.IntializePanel();

            // -- Create the database cache folder.
            this.CreateDbFolder();

            this._SelectionOrder.Clear();

            this._IsValidSourceFilter = true;

            this.IndicatorNIds = string.Empty;

            this._GalleryKeywords = string.Empty;

            this._SelectedAreaLevel = 2;
        }