private void WriteAll(string file_path, byte[] info) { string parent_folder = PathFunctions.GetParentFolderPath(file_path); CreateAllFolders(parent_folder); File.WriteAllBytes(file_path, info); }
private void CreateAllFolders(string folder_path) { if (!Directory.Exists(folder_path)) { string parent_folder = PathFunctions.GetParentFolderPath(folder_path); CreateAllFolders(parent_folder); Directory.CreateDirectory(folder_path); } }
private void InitializeFormFields() { _operations = new Action[2]; _operations[(int)TypeOfOperation.encode] = Encode; _operations[(int)TypeOfOperation.decode] = Decode; Application.ApplicationExit += new EventHandler(this.OnApplicationExit); _token_source = new CancellationTokenSource(); _canc_token = _token_source.Token; ResetProgressBarDelegate = new Reset(ResetProgressBar); PerformStepDelegate = new Perform(PerformStep); OfferToSkip = new Message(CheckIfCorrectPath); _destination_folder_path = PathFunctions.SetDestinationFolderPath(_source_file_or_folder_path); }