private void FileSystemRenamed(object sender, RenamedEventArgs e) { if (!HandleExternalModifications(e.Name)) { return; } Logger.Trace("Handling FileSystemWatcher rename activity notification."); Provider.RemoveFile(e.OldFullPath, true); Provider.AddFile(e.FullPath); UiDispatcher.InvokeAsync(Refresh); }
private void _fileSystemWatcher_Renamed(object sender, RenamedEventArgs e) { // the file system filter doesn't support multiple filters if (!VbFileExtensions.Contains(e.Name.Split('.').Last())) { return; } if (!Provider.NotifyExternalFileChanges) { return; } Logger.Trace("File system watcher detected file renamed"); if (_messageBox.Show(RubberduckUI.SourceControl_ExternalModifications, RubberduckUI.SourceControlPanel_Caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) == DialogResult.OK) { Provider.RemoveFile(e.OldFullPath, true); Provider.AddFile(e.FullPath); UiDispatcher.InvokeAsync(Refresh); } }