private void HandleDirectoryChanged(string path) { // Do these one at a time. lock (directoryChangeLock) { DirectoryInfo info = new DirectoryInfo(path); MFS.IDirectoryItem item = GetFromLocalPath(path); if (item == null && info != null) { // New Directory! MFS.LocalDirectory parentDirectory = GetParentDirectory(info); if (parentDirectory != null) { this.loggingService.LogDebug("NEW DIR !! " + path); parentDirectory.CreateSubDirectory(info.Name, info.FullName); } else { // No parent directory, this happens because // we can get events out of order. this.loggingService.LogDebug("NEW DIR NO PARENT !! " + path); CreateDirectoryForLocalPath(path); } } } }
private void HandleFileChanged(string path) { FileInfo info = new FileInfo(path); MFS.IDirectoryItem item = GetFromLocalPath(path); if (item == null) { // New File! MFS.LocalDirectory parentDirectory = GetParentDirectory(info); this.loggingService.LogDebug("NEW FILE!! IN " + parentDirectory.FullPath); } else { // Updated File! this.loggingService.LogWarning("NOTE: Changed file detected, however handling this is not currently supported. Path: {0}", item.FullPath); } }