예제 #1
0
        /// <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]);
        }