public static void ReplaceObjects() { Logger.WriteLine("ReplaceObjects", "Write TestFileName for new DLL.", ConsoleColor.White); string testFileName = Console.ReadLine(); FileWorker.Files = new List <FileInfo>(); FileWorker.LoadHierarchy(filedir); FileWorker.Files = FileWorker.Files.Where(w => !w.FullName.Contains(filedir + @"\bin\") && !w.FullName.Contains(filedir + @"\obj\")).ToList(); foreach (FileInfo file in FileWorker.Files) { ContentWorker content = new ContentWorker(file); Dictionary <string, string> words = new Dictionary <string, string>(); words.Add("%filename%", testFileName); words.Add("%dllname%", dll); words.Add("%25dllname%25", dll); content.Replace(words); content.SaveFile(); } }
public static void CreateDuplicate(string dllName = null) { if (dllName != null) { filedir = AppDomain.CurrentDomain.BaseDirectory + dllName; dll = dllName; } Logger.WriteLine("FileWorker", "Writing in '" + filedir + "'", ConsoleColor.White); if (Directory.Exists(filedir)) { Logger.WriteLine("FileWorker", "Folder is Exist.", ConsoleColor.White); Logger.WriteLine("FileWorker", "Deleting...", ConsoleColor.White); FileWorker.DeleteDirectory(filedir); } Logger.WriteLine("FileWorker", "Copying Folder...", ConsoleColor.White); FileWorker.DirectoryCopy(filenameOrig, filedir, true); Logger.WriteLine("FileWorker", "Successfully created copy.", ConsoleColor.White); }