public void ModifyFile(ISyncedFolder syncFolder, string filePath, UpdateType updateType, string renameFilename) { SyncedFolder = syncFolder; string remotePath = GetRemotePath(filePath); switch (updateType) { case UpdateType.Change | UpdateType.Create: File.Copy(filePath, remotePath, true); break; case UpdateType.Delete: if (File.Exists(remotePath)) { File.Delete(remotePath); } break; case UpdateType.Rename: if (File.Exists(remotePath)) { File.Move(remotePath, renameFilename); } break; default: break; } }
public void ModifyFolder(ISyncedFolder syncFolder, string folderPath, UpdateType updateType, string renameFile) { SyncedFolder = syncFolder; string remotePath = GetRemotePath(folderPath); switch (updateType) { case UpdateType.Change: DirectoryInfo localInfo = new DirectoryInfo(folderPath); DirectoryInfo remoteInfo = new DirectoryInfo(remotePath); remoteInfo.Attributes = localInfo.Attributes; break; case UpdateType.Create: Directory.CreateDirectory(remotePath); break; case UpdateType.Delete: Directory.Delete(remotePath); break; case UpdateType.Rename: Directory.Move(remotePath, renameFile); break; default: break; } }
public void ModifyFolder(ISyncedFolder syncFolder, string folderPath, UpdateType updateType, string renameFile) { _checker.Message = "ModifyFolder"; }