Пример #1
0
        /// <summary>
        /// Retrieves the repository details  saved to a file if available
        /// </summary>
        public static void initializeSavedInfo()
        {
            bool status;

            if (Directory.Exists(defaultFolderPath))
            {
                string serializeFileName = "seeSharpDB";
                if (File.Exists(serializeFileName))
                {
                    StorageDetailsSR storageDetailsSR = new StorageDetailsSR();
                    storageDetails = storageDetailsSR.Retrieve();

                    status = false;
                }
                else
                {
                    storageDetails = new StorageDetails(defaultFolderPath);
                    status         = false;
                }
            }
            else
            {
                Directory.CreateDirectory(defaultFolderPath);
                storageDetails = new StorageDetails(defaultFolderPath);
                status         = true;
            }

            UpdateThread updateThread = new UpdateThread(status);
            Thread       thread       = new Thread(new ThreadStart(updateThread.run));

            thread.Start();
        }
Пример #2
0
        /// <summary>
        /// This method saves the storage details needed t be persistent to a file
        /// </summary>
        public void saveStorageDetails()
        {
            StorageDetailsSR storageDetailsSR = new StorageDetailsSR();

            storageDetailsSR.Save(storageDetails);
            storageDetailsSR.Exit();
        }
Пример #3
0
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Console.WriteLine("nanananananananannanananananaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa goodbye");
            StorageDetailsSR storageDetailsSR = new StorageDetailsSR();

            storageDetailsSR.Save(Storage.getStorageDetails());
            storageDetailsSR.Exit();
        }