示例#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));
            }
        }
        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);
        }
        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)));
        }
        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)));
        }