示例#1
0
 void NotifyNestingRulesChanged(ProjectFileNestingInfo nestingInfo)
 {
     if (nestingInfo != null && fileNestingEnabled)
     {
         FileNestingService.NotifyNestingRulesChanged(nestingInfo.File, nestingInfo.Parent);
     }
 }
示例#2
0
        void OnUserPropertiesChanged(object sender, Core.PropertyBagChangedEventArgs e)
        {
            bool newValue = FileNestingService.IsEnabledForProject(Project);

            if (fileNestingEnabled != newValue)
            {
                fileNestingEnabled = newValue;
                FileNestingService.NotifyNestingRulesChanged(Project);
            }
        }
示例#3
0
        void OnFileRemovedFromProject(object sender, ProjectFileEventArgs e)
        {
            foreach (var file in e)
            {
                RemoveFile(file.ProjectFile);
            }

            if (fileNestingEnabled)
            {
                FileNestingService.NotifyNestingRulesChanged(Project);
            }
        }
示例#4
0
        void EnsureInitialized()
        {
            if (!initialized)
            {
                initialized = true;

                fileNestingEnabled = FileNestingService.IsEnabledForProject(Project);
                foreach (var file in Project.Files)
                {
                    AddFile(file);
                }
            }
        }
示例#5
0
        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);
                    }
                }
            }
        }
示例#6
0
        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;
        }