示例#1
0
        public static void RenameDirectoryProject(string oldProjectName, string newProjectName)
        {
            DirectoryInfo di    = new DirectoryInfo(ConfigDirectories.GetDocumentsFolder() + oldProjectName);
            DirectoryInfo ddest = new DirectoryInfo(ConfigDirectories.GetDocumentsFolder() + newProjectName);

            if (di.Exists && !ddest.Exists)
            {
                di.MoveTo(ConfigDirectories.GetDocumentsFolder() + newProjectName);
            }
            else
            {
                throw new IOException();
            }
            FileInfo fi    = new FileInfo(ConfigDirectories.GetMyDocumentsFolder() + oldProjectName + ".bin");
            FileInfo fdest = new FileInfo(ConfigDirectories.GetMyDocumentsFolder() + newProjectName + ".bin");

            if (fi.Exists && !fdest.Exists)
            {
                fi.MoveTo(ConfigDirectories.GetDocumentsFolder() + newProjectName + ".bin");
            }
            else
            {
                throw new IOException();
            }
        }
示例#2
0
        public static void CreateMyDocuments()
        {
            DirectoryInfo di = new DirectoryInfo(ConfigDirectories.GetMyDocumentsFolder());

            if (!di.Exists)
            {
                di.Create();
            }
        }
示例#3
0
        public static void AddFolder(string projectName, string folder)
        {
            DirectoryInfo di = new DirectoryInfo(ConfigDirectories.GetBuildFolder(projectName));

            if (!di.Exists)
            {
                di.Create();
            }
            string[] path = folder.Split('/');
            foreach (string s in path)
            {
                if (!String.IsNullOrEmpty(s))
                {
                    DirectoryInfo subDir = new DirectoryInfo(Path.Combine(di.FullName, s));
                    if (!subDir.Exists)
                    {
                        subDir.Create();
                    }
                    di = subDir;
                }
            }
        }
示例#4
0
        public static void CreateDirectoryProject(string projectName)
        {
            DirectoryInfo di = new DirectoryInfo(Path.Combine(ConfigDirectories.GetDocumentsFolder(), projectName));

            if (!di.Exists)
            {
                di.Create();
            }
            di = new DirectoryInfo(Path.Combine(ConfigDirectories.GetDocumentsFolder(), projectName, "build"));
            if (!di.Exists)
            {
                di.Create();
            }
            di = new DirectoryInfo(Path.Combine(ConfigDirectories.GetDocumentsFolder(), projectName, "production"));
            if (!di.Exists)
            {
                di.Create();
            }
            FileInfo fi = new FileInfo(Path.Combine(ConfigDirectories.GetDocumentsFolder(), projectName, "build", "ehd_ask.png"));

            if (!fi.Exists)
            {
                FileInfo src = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "ehd_ask.png");
                src.CopyTo(fi.FullName, true);
            }
            fi = new FileInfo(Path.Combine(ConfigDirectories.GetDocumentsFolder(), projectName, "build", "ehd_plus.png"));
            if (!fi.Exists)
            {
                FileInfo src = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "ehd_plus.png");
                src.CopyTo(fi.FullName, true);
            }
            fi = new FileInfo(Path.Combine(ConfigDirectories.GetDocumentsFolder(), projectName, "build", "ehd_minus.png"));
            if (!fi.Exists)
            {
                FileInfo src = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "ehd_minus.png");
                src.CopyTo(fi.FullName, true);
            }
        }
示例#5
0
 public static string GetDefaultProductionFolder(string projectName)
 {
     return(Path.Combine(ConfigDirectories.GetMyDocumentsFolder(), projectName, "production") + Path.DirectorySeparatorChar);
 }
示例#6
0
 public static string GetLogicalFolder(string projectName, string fileName)
 {
     return(ConfigDirectories.RemoveLeadBackslash(ConfigDirectories.GetBuildFolder(projectName, fileName)));
 }
示例#7
0
 public static string GetBuildFolder(string projectName, string fileName)
 {
     ConfigDirectories.CreateDirectoryProject(projectName);
     return(Path.Combine(ConfigDirectories.GetMyDocumentsFolder(), projectName, "build", fileName));
 }
示例#8
0
 public static string GetBuildFolder(string projectName)
 {
     ConfigDirectories.CreateDirectoryProject(projectName);
     return(Path.Combine(ConfigDirectories.GetMyDocumentsFolder(), projectName, "build") + Path.DirectorySeparatorChar);
 }
示例#9
0
 public static string GetDocumentsFolder()
 {
     return(ConfigDirectories.GetMyDocumentsFolder());
 }