void NotifyNestingRulesChanged(ProjectFileNestingInfo nestingInfo) { if (nestingInfo != null && fileNestingEnabled) { FileNestingService.NotifyNestingRulesChanged(nestingInfo.File, nestingInfo.Parent); } }
void OnUserPropertiesChanged(object sender, Core.PropertyBagChangedEventArgs e) { bool newValue = FileNestingService.IsEnabledForProject(Project); if (fileNestingEnabled != newValue) { fileNestingEnabled = newValue; FileNestingService.NotifyNestingRulesChanged(Project); } }
void OnFileRemovedFromProject(object sender, ProjectFileEventArgs e) { foreach (var file in e) { RemoveFile(file.ProjectFile); } if (fileNestingEnabled) { FileNestingService.NotifyNestingRulesChanged(Project); } }
void EnsureInitialized() { if (!initialized) { initialized = true; fileNestingEnabled = FileNestingService.IsEnabledForProject(Project); foreach (var file in Project.Files) { AddFile(file); } } }
void OnUserPropertiesChanged(object sender, Core.PropertyBagChangedEventArgs e) { bool newValue = FileNestingService.IsEnabledForProject(Project); if (fileNestingEnabled != newValue) { fileNestingEnabled = newValue; foreach (var kvp in projectFiles) { var nestingInfo = kvp.Value; if (nestingInfo.Children != null) { FileNestingService.NotifyNestingRulesChanged(nestingInfo.File, null); } } } }
void AddFile(ProjectFile projectFile) { var tmp = projectFiles.GetOrAdd(projectFile, new ProjectFileNestingInfo(projectFile)); tmp.Parent = FileNestingService.InternalGetParentFile(projectFile); if (tmp.Parent != null) { var parent = projectFiles.GetOrAdd(tmp.Parent, new ProjectFileNestingInfo(tmp.Parent)); if (parent.Children == null) { parent.Children = new ProjectFileCollection(); } if (parent.Children.GetFile(projectFile.FilePath) == null) { parent.Children.Add(projectFile); } } projectFiles [projectFile] = tmp; }