Beispiel #1
0
 internal void AddDestionationFile(BaseFile destinationFile)
 {
     if (!destinationFile.FileInfo.Exists) {
         //TODO: here must be notification message
         throw new FileNotFoundException("Destination file does not find");
     }
     destinations.Add(destinationFile.Path, destinationFile);
 }
Beispiel #2
0
 internal void AddDestionationFile(string destinationPath)
 {
     BaseFile dest = new BaseFile(destinationPath);
     if (!dest.FileInfo.Exists) {
         //TODO: here must be notification message
         throw new FileNotFoundException("Destination file does not find");
     }
     destinations.Add(destinationPath, dest);
 }
Beispiel #3
0
        private void RegisterPaths(BaseFile sourceFile, BaseFile destinationFile = null)
        {
            if (!sourceFile.FileInfo.Exists) {
                //TODO: here must be notification message
                throw new FileNotFoundException("Source file does not find");
            }
            source = sourceFile;
            CreateWatcher(source.FileInfo.DirectoryName, source.FileInfo.Name);

            if (destinationFile != null) {
                if (!destinationFile.FileInfo.Exists) {
                    //TODO: here must be notification message
                    throw new FileNotFoundException("Source file does not find");
                }
                destinations.Add(destinationFile.Path, destinationFile);
            }
        }
Beispiel #4
0
 internal FileController(BaseFile sourceFile, BaseFile destinationFile)
 {
     RegisterPaths(sourceFile, destinationFile);
 }
Beispiel #5
0
        private void RegisterSource(string sourcePath, string destinationPath = "")
        {
            source = new BaseFile(sourcePath);
            if (!source.FileInfo.Exists) {
                //TODO: here must be notification message
                throw new FileNotFoundException("Source file does not find");
            }
            CreateWatcher(source.FileInfo.DirectoryName, source.FileInfo.Name);

            if (destinationPath != null && !destinationPath.Equals("")) {
                BaseFile dest = new BaseFile(destinationPath);
                if (!dest.FileInfo.Exists) {
                    //TODO: here must be notification message
                    throw new FileNotFoundException("Destination file does not find");
                }
                destinations.Add(destinationPath, dest);
            }
        }