public void HandleRenamedComponent(VBComponent component, string oldName) { if (Provider == null || !Provider.HandleVbeSinkEvents) { return; } if (component.Collection.Parent.HelpFile != Provider.CurrentRepository.Id) { return; } var fileStatus = Provider.LastKnownStatus().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == oldName); if (fileStatus != null) { var directory = Provider.CurrentRepository.LocalLocation; directory += directory.EndsWith("\\") ? string.Empty : "\\"; var fileExt = "." + fileStatus.FilePath.Split('.').Last(); _fileSystemWatcher.EnableRaisingEvents = false; File.Move(directory + fileStatus.FilePath, directory + component.Name + fileExt); _fileSystemWatcher.EnableRaisingEvents = true; Provider.RemoveFile(oldName + fileExt, false); Provider.AddFile(component.Name + fileExt); } }
private void ComponentRenamed(object sender, ComponentRenamedEventArgs e) { if (!_listening || Provider == null || !Provider.HandleVbeSinkEvents) { return; } if (e.ProjectId != Provider.CurrentRepository.Id) { return; } Logger.Trace("Component {0} renamed to {1}", e.OldName, e.Component.Name); var fileStatus = Provider.LastKnownStatus().SingleOrDefault(stat => Path.GetFileNameWithoutExtension(stat.FilePath) == e.OldName); if (fileStatus != null) { var directory = Provider.CurrentRepository.LocalLocation; var fileExt = "." + Path.GetExtension(fileStatus.FilePath); _fileSystemWatcher.EnableRaisingEvents = false; File.Move(Path.Combine(directory, fileStatus.FilePath), Path.Combine(directory, e.Component.Name + fileExt)); _fileSystemWatcher.EnableRaisingEvents = true; Provider.RemoveFile(e.OldName + fileExt, false); Provider.AddFile(e.Component.Name + fileExt); } }
private void ComponentRenamed(object sender, IComponentRenamedEventArgs e) { if (Provider == null || !Provider.HandleVbeSinkEvents) { return; } if (e.ProjectId != Provider.CurrentRepository.Id) { return; } Logger.Trace("Component {0} renamed to {1}", e.OldName, e.Component.Name); var fileStatus = Provider.LastKnownStatus().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == e.OldName); if (fileStatus != null) { var directory = Provider.CurrentRepository.LocalLocation; directory += directory.EndsWith("\\") ? string.Empty : "\\"; var fileExt = "." + fileStatus.FilePath.Split('.').Last(); _fileSystemWatcher.EnableRaisingEvents = false; File.Move(directory + fileStatus.FilePath, directory + e.Component.Name + fileExt); _fileSystemWatcher.EnableRaisingEvents = true; Provider.RemoveFile(e.OldName + fileExt, false); Provider.AddFile(e.Component.Name + fileExt); } }
private void IncludeChanges(IFileStatusEntry fileStatusEntry) { if (UntrackedFiles.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath) != null) { Provider.AddFile(fileStatusEntry.FilePath); } else { ExcludedChanges.Remove(ExcludedChanges.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath)); } RefreshView(); }
private void IncludeChanges(IFileStatusEntry fileStatusEntry) { if (UntrackedFiles.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath) != null) { Logger.Trace("Tracking file {0}", fileStatusEntry.FilePath); Provider.AddFile(fileStatusEntry.FilePath); } else { Logger.Trace("Removing file {0} from excluded changes", fileStatusEntry.FilePath); ExcludedChanges.Remove(ExcludedChanges.FirstOrDefault(f => f.FilePath == fileStatusEntry.FilePath)); } RefreshView(); }
public void HandleAddedComponent(VBComponent component) { if (Provider == null || !Provider.HandleVbeSinkEvents) { return; } if (component.Collection.Parent.HelpFile != Provider.CurrentRepository.Id) { return; } var fileStatus = Provider.Status().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == component.Name); if (fileStatus != null) { Provider.AddFile(fileStatus.FilePath); } }
private void ComponentAdded(object sender, ComponentEventArgs e) { if (!_listening || Provider == null || !Provider.HandleVbeSinkEvents) { return; } if (e.ProjectId != Provider.CurrentRepository.Id) { return; } Logger.Trace("Component {0} added", e.Component.Name); var fileStatus = Provider.Status().SingleOrDefault(stat => Path.GetFileNameWithoutExtension(stat.FilePath) == e.Component.Name); if (fileStatus != null) { Provider.AddFile(fileStatus.FilePath); } }
private void ComponentAdded(object sender, IComponentEventArgs e) { if (Provider == null || !Provider.HandleVbeSinkEvents) { return; } if (e.ProjectId != Provider.CurrentRepository.Id) { return; } Logger.Trace("Component {0} added", e.Component.Name); var fileStatus = Provider.Status().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == e.Component.Name); if (fileStatus != null) { Provider.AddFile(fileStatus.FilePath); } }