Пример #1
0
        private IEnumerable <OpenInEditorToggleViewModel> BuildAllViewModelsAsync()
        {
            Log.Info("Loading files.");

            var solutionPath = Configuration.SolutionPath;
            var filters      = new FileWalkerFilter[]
            {
                new HiddenFolderFilter(),
                new SolutionFileFilter(),
                new BuildArtifactsFilter(),
                new NugetFolderFilter(),
            };
            var allFiles          = FileWalker.FromFile(solutionPath, filters);
            var solutionUri       = new Uri(solutionPath, UriKind.Absolute);
            var currentReferences = new HashSet <string>(Configuration.OpenInEditorReferences);
            var viewModels        = allFiles.Select(file =>
            {
                var vm      = new OpenInEditorToggleViewModel(file, solutionUri);
                vm.Included = currentReferences.Contains(vm.RelativePath.OriginalString);
                return(vm);
            });

            Log.Info("Files loaded.");

            return(viewModels);
        }
Пример #2
0
        public IEnumerable <string> GetAdditiontalDocuments(string projectFilePath)
        {
            var filters = new FileWalkerFilter[]
            {
                new TemplateFileFilter(),
                new ProjectFileFilter(),
                new BuildArtifactsFilter(),
                new HiddenFolderFilter(),
                new SolutionFilter(Solution)
                {
                    FilterDocuments = true
                }
            };

            foreach (var p in FileWalker.FromFile(projectFilePath, filters))
            {
                yield return(p);
            }
        }