예제 #1
0
        public void AddProject(string path)
        {
            var projectPath = ProjectPathHelper.NormalizeProjectDirectoryPath(path);

            if (projectPath != null)
            {
                _needRefresh = _projects.Add(path);
            }
        }
예제 #2
0
        public Project ReadProject(string projectPath, ProjectReaderSettings settings)
        {
            projectPath = ProjectPathHelper.NormalizeProjectFilePath(projectPath);

            var name = Path.GetFileName(Path.GetDirectoryName(projectPath));

            using (var stream = new FileStream(projectPath, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                return(ReadProject(stream, name, projectPath, settings));
            }
        }
예제 #3
0
        private LockFile GetLockFile(string projectDirectory)
        {
            var normalizedPath = ProjectPathHelper.NormalizeProjectDirectoryPath(projectDirectory);

            if (normalizedPath == null)
            {
                return(null);
            }

            return(_lockFileCache.AddOrUpdate(
                       normalizedPath,
                       key => AddLockFileEntry(key, null),
                       (key, oldEntry) => AddLockFileEntry(key, oldEntry)).Model);
        }
예제 #4
0
        private FileModelEntry <Project> GetProjectCore(string projectDirectory)
        {
            var normalizedPath = ProjectPathHelper.NormalizeProjectDirectoryPath(projectDirectory);

            if (normalizedPath == null)
            {
                return(null);
            }

            return(_projectsCache.AddOrUpdate(
                       normalizedPath,
                       key => AddProjectEntry(key, null),
                       (key, oldEntry) => AddProjectEntry(key, oldEntry)));
        }
예제 #5
0
        public ProjectContextCollection GetProjectContextCollection(string projectPath, bool clearCache)
        {
            var normalizedPath = ProjectPathHelper.NormalizeProjectDirectoryPath(projectPath);

            if (normalizedPath == null)
            {
                return(null);
            }

            if (clearCache)
            {
                _projectContextsCache.Clear();
                _projectsCache.Clear();
                _lockFileCache.Clear();
            }

            return(_projectContextsCache.AddOrUpdate(
                       normalizedPath,
                       key => AddProjectContextEntry(key, null),
                       (key, oldEntry) => AddProjectContextEntry(key, oldEntry)));
        }