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()); }
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); }