Example #1
0
 public void deleteMod(String path, Mod mod)
 {
     foreach (String file in mod.getFiles())
         if (!String.IsNullOrEmpty(file))
             File.Delete(path + "\\" + file);
     foreach (String folder in mod.getFolders())
         if (!String.IsNullOrEmpty(folder))
             DeleteDirectory(path + "\\" + folder);
 }
Example #2
0
        public Mod buildMod(String p)
        {
            if (p != "" || p != null)
            {
                String fileName = Path.GetFileName(p);
                Mod tmpMod = new Mod(fileName);

                foreach (String file in Directory.GetFiles(p))
                    if (!String.IsNullOrEmpty(file))
                        tmpMod.addFile(Path.GetFileName(file));
                foreach (String folder in Directory.GetDirectories(p))
                    if (!String.IsNullOrEmpty(folder))
                        tmpMod.addFolder(Path.GetFileName(folder));

                return tmpMod;
            }
            else
                return null;
        }