/// <summary> /// Modify value of save works objects stored in workList, if there is any null parameters the value attached isn't changed /// </summary> /// <param name="_nb">Index of the work you want to change in the list</param> /// <param name="_name">New name to apply to the work</param> /// <param name="_sourcePath">New source path to apply to the work</param> /// <param name="_destinationPath">New target destination path to apply to the work</param> /// <param name="_type">New type of save work to apply to the work</param> public void ChangeWork(int _nb, string _name, string _sourcePath, string _destinationPath, SaveWorkType _type, List <Extension> _extension) { if (_type != WorkList[_nb].Type && _type == SaveWorkType.complete) { WorkList[_nb] = new CompleteSaveWork(_name, _sourcePath, _destinationPath, _extension, SaveWorkType.complete); } else if (_type != WorkList[_nb].Type && _type == SaveWorkType.differencial) { WorkList[_nb] = new DifferencialSaveWork(_name, _sourcePath, _destinationPath, _extension, SaveWorkType.differencial); } else { if (_name != "") { WorkList[_nb].Name = _name; } if (_sourcePath != "") { WorkList[_nb].SourcePath = _sourcePath; } if (_destinationPath != "") { WorkList[_nb].DestinationPath = _destinationPath; } WorkList[_nb].ExtentionToEncryptList = _extension; } SetWorkIndex(); UpdateSaveFile(); EditLog.ChangeWorkLogLine(WorkList[_nb]); }
/// <summary> /// Create a save work (with a differential save algorithm) /// </summary> /// <param name="_name">Name of the work (must be different from existing ones)</param> /// <param name="_source">The Source path to save</param> /// <param name="_destination">The Target destination to save files in</param> public void CreateDifferencialWork(string _name, string _source, string _destination, List <Extension> _extension) { DifferencialSaveWork work = new DifferencialSaveWork(_name, _source, _destination, _extension, SaveWorkType.differencial); WorkList.Add(work); SetWorkIndex(); UpdateSaveFile(); EditLog.CreateWorkLogLine(work); }