public void WindowClosing(Window window) { if (window.Type == vsWindowType.vsWindowTypeDocument) { _documentMetadataManager.Synchronize(window.DTE.Documents, true); } }
public void ProjectRenamed(Project project, string oldName) { _projectBrushService.UpdateBrushId(oldName, project.FullName); // Synchronize after updating brush ID so the project continues to // use the same brush _documentMetadataManager.Synchronize(project.DTE.Documents, true); }
public async Task ProjectAdded(Project project) { var xmlDocument = new XmlDocument(); xmlDocument.Load(project.FullName); var nodes = xmlDocument.GetElementsByTagName("ProjectTypeGuids"); var guids = nodes[0]?.InnerText; var isUnityProject = guids != null && guids.Contains("{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1}"); if (isUnityProject && _userPreferences.UnityRefreshDelay != 0) { await Task.Delay(_userPreferences.UnityRefreshDelay); _documentMetadataManager.Synchronize(project.DTE.Documents, true); } }
public void Execute(object parameter) { var metadata = parameter as DocumentMetadata; if (metadata == null) { return; } Window window = null; foreach (var itm in _dte2.Documents) { var document = (Document)itm; var match = _metadataEqualityService.Compare( document.FullName, metadata.FullName); if (match) { var enumerator = document.Windows.GetEnumerator(); if (enumerator.MoveNext()) { window = (Window)enumerator.Current; } break; } } if (window == null) { var item = _projectItemService.FindProjectItem(metadata.FullName); window = item?.Open(); } if (window == null) { _documentMetadataManager.Synchronize(_dte2.Documents, true); } else { window.Activate(); } }
public void ItemRemoved(ProjectItem projectItem) { _documentMetadataManager.Synchronize(projectItem.DTE.Documents, true); }