Exemple #1
0
        public Fixer(DataGridViewRow row)
        {
            var updated  = row.Cells[Resources.Interface_Column_Updated].Value.ToString();
            var obsolete = row.Cells[Resources.Interface_Column_Obsolete].Value.ToString();

            var relativePath = row.Cells[Resources.Interface_Column_Path].Value.ToString();
            var file         = row.Cells[Resources.Interface_Column_FileName].Value.ToString();

            origin  = new FileToWrite(updated, relativePath, file);
            destiny = new FileToWrite(obsolete, relativePath, file);
        }
Exemple #2
0
        private static Boolean copy(FileToWrite origin, FileToWrite destiny)
        {
            if (File.Exists(origin.Path))
            {
                File.Copy(origin.Path, destiny.Path, true);
                return(true);
            }

            if (Directory.Exists(origin.Path))
            {
                copyDirectory(origin.Path, destiny.Path);
                return(true);
            }

            throw new ApplicationException(Resources.Fixer_WeirdItemType);
        }
Exemple #3
0
        private static Boolean delete(FileToWrite wrong)
        {
            if (File.Exists(wrong.Path))
            {
                File.Delete(wrong.Path);
                return(true);
            }

            if (Directory.Exists(wrong.Path))
            {
                Directory.Delete(wrong.Path, true);
                return(true);
            }

            throw new ApplicationException(Resources.Fixer_WeirdItemType);
        }