create needed folders if they not exist

This commit is contained in:
Alexander Eckart committed 2012-02-24 07:53:51 +01:00
1 parent 0e73a77c0b
commit bc0e42af45
5 files changed
+26 -10

No files matched your search

+22 -1
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace Vocaluxe.Base
@@ -93,7 +94,7 @@ namespace Vocaluxe.Base
public static bool TabNavigation = false;
public const float BackgroundMusicFadeTime = 0.5f;
public static string GetVersionText()
{
string sVersion = "v" + iVersionMajor.ToString() + "." +
@@ -140,5 +141,25 @@ namespace Vocaluxe.Base
{
MouseMoveDiffMin = 3;
}
public static void CreateFolders()
{
List<string> Folders = new List<string>();
Folders.Add(sFolderCover);
Folders.Add(sFolderFonts);
Folders.Add(sFolderProfiles);
Folders.Add(sFolderSongs);
Folders.Add(sFolderScreenshots);
Folders.Add(sFolderBackgroundMusic);
Folders.Add(sFolderSounds);
foreach (string folder in Folders)
{
string path = Path.Combine(Environment.CurrentDirectory, folder);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
}
}
}
}
+1 -3
View File
@@ -461,9 +461,7 @@ namespace Vocaluxe.Lib.Draw
{
string file = "Screenshot_";
string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
int i = 0;
while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".bmp")))
i++;
+1 -3
View File
@@ -300,9 +300,7 @@ namespace Vocaluxe.Lib.Draw
{
string file = "Screenshot_";
string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
int i = 0;
while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".png")))
i++;
+1 -3
View File
@@ -556,9 +556,7 @@ namespace Vocaluxe.Lib.Draw
{
string file = "Screenshot_";
string path = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderScreenshots);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
int i = 0;
while (File.Exists(Path.Combine(path, file + i.ToString("00000") + ".bmp")))
i++;
+1
View File
@@ -33,6 +33,7 @@ namespace Vocaluxe
// Init Log
CLog.Init();
CSettings.CreateFolders();
Application.DoEvents();
// Init Language