//This function creates the directory for the session. It just creates the base session however. //This function also checks if there is any files in the path specified. If there is another form appears and confirms if it they want the files deleted. //If they confirm all the files are deleted and then a new directory is created. The odds of this happening are slim becuase most people only need one recording per class per day. public bool Make_Session_Directory() { bool choice = false; if (session_created == false) { string session_URL = get_Session_URL(); if (!Check_If_Folder_Clear(Root_Session_Url)) { System.IO.Directory.CreateDirectory(Root_Session_Url); } else { var Pop_up = new Pop_Up_Warning(Root_Session_Url); Pop_up.ShowDialog(); //Application.Run(Pop_up); choice = Pop_up.Get_Choice(); if (choice == true) { System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(session_URL); foreach (System.IO.FileInfo file in di.GetFiles()) { file.Delete(); } foreach (System.IO.DirectoryInfo dir in di.GetDirectories()) { dir.Delete(true); } System.IO.Directory.CreateDirectory(Root_Session_Url); } } } return(true); }
//This is the same as the Make directory in the base class but is used for just the translated_text folder only. While the base class is for audio and text. protected bool Make_Translation_Directory() { string session_URL = get_Session_URL(); if (!System.IO.Directory.Exists(Root_Text_Url)) { System.IO.Directory.CreateDirectory(Root_Text_Url); } else { bool choice = false; var Pop_up = new Pop_Up_Warning(Root_Text_Url); Pop_up.ShowDialog(); choice = Pop_up.Get_Choice(); if (choice == true) { System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(session_URL); foreach (System.IO.FileInfo file in di.GetFiles()) { file.Delete(); } foreach (System.IO.DirectoryInfo dir in di.GetDirectories()) { dir.Delete(true); } System.IO.Directory.CreateDirectory(Root_Text_Url); } } return(true); }