Пример #1
0
        static void Main(string[] args)
        {
            string baseDir                 = AppDomain.CurrentDomain.BaseDirectory;
            string storageFilesDir         = ConfigurationManager.AppSettings["storageFilesDir"];
            string absoluteStorageFilesDir = baseDir + storageFilesDir;

            if (!Directory.Exists(absoluteStorageFilesDir))
            {
                Directory.CreateDirectory(absoluteStorageFilesDir);
                StorageControl sControl = new StorageControl();
                sControl.CreateNewStorage("objectsStorage.db");
            }

            string packageSourceDir = ConfigurationManager.AppSettings["packageSourceDir"];

            Directory.CreateDirectory(baseDir + packageSourceDir);
            string packageDownloadDir = ConfigurationManager.AppSettings["packageDownloadDir"];

            Directory.CreateDirectory(baseDir + packageDownloadDir);



            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainWindow());
        }
Пример #2
0
 private void btSwitchStorage_Click(object sender, EventArgs e)
 {
     SetUIBlockState(block: true);
     try
     {
         StorageControl sControl = new StorageControl();
         sControl.SwitchStorage(lbStorageFiles.SelectedItem.ToString());
         tbOutput.AppendText($"\r\nSTORAGE SWITCHED TO {lbStorageFiles.SelectedItem.ToString()}\r\n");
         ScrollToEnd();
     }
     catch (Exception ex)
     {
         tbOutput.AppendText($"\r\nException occured: {ex.Message}\r\n");
     }
     SetUIBlockState(block: false);
 }
Пример #3
0
        private void btnCreateNewStorage_Click(object sender, EventArgs e)
        {
            SetUIBlockState(block: true);
            try
            {
                StorageControl sControl           = new StorageControl();
                var            newStorageFileName = tbNewStorageName.Text;
                sControl.CreateNewStorage(newStorageFileName);

                refreshStorageFiles();
            }
            catch (Exception ex)
            {
                tbOutput.AppendText($"\r\nException occured: {ex.Message}\r\n");
            }
            SetUIBlockState(block: false);
        }