Пример #1
0
        public RepoFile(RepoProject project, string filePath, string logicalPath = null)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(filePath);
            }

            PrimaryProject   = project;
            FilePath         = filePath;
            this.logicalPath = logicalPath;
        }
Пример #2
0
        public RepoProject CreateRepoProject(string projectId, string projectDirectory, RepoFile projectFile = null)
        {
            var project = new RepoProject(projectId, this)
            {
                ProjectDirectory = projectDirectory,
                ProjectFile      = projectFile
            };

            if (projectFile != null)
            {
                projectFile.PrimaryProject = project;
                project.AddFile(projectFile);
            }

            Projects.Add(project);

            return(project);
        }
Пример #3
0
        public Repo(string repoName, string repoRoot, AnalysisServices analysisServices)
        {
            Debug.Assert(!string.IsNullOrEmpty(analysisServices.TargetIndex));
            Name             = repoName;
            AnalysisServices = analysisServices;
            Roots.AddRange(analysisServices.NamedRoots);

            Roots.Add(new NamedRoot("RepoRoot", repoRoot));
            Roots.Add(new NamedRoot("ProgramFiles", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)));
            Roots.Add(new NamedRoot("ProgramFilesX86", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)));
            Roots.Add(new NamedRoot("System", Environment.GetFolderPath(Environment.SpecialFolder.System)));
            Roots.Add(new NamedRoot("SystemX86", Environment.GetFolderPath(Environment.SpecialFolder.SystemX86)));
            Roots.Add(new NamedRoot("Windows", Environment.GetFolderPath(Environment.SpecialFolder.Windows)));
            Roots.Add(new NamedRoot("Temp", Environment.GetEnvironmentVariable("Temp")));
            Roots.Add(new NamedRoot("UserProfile", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)));
            Roots.Add(new NamedRoot("ProgramData", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)));
            Roots.Sort((m1, m2) => - m1.Path.Length.CompareTo(m2.Path.Length));
            Roots = Roots.Select(m => new NamedRoot(m.Name, PathUtilities.EnsureTrailingSlash(m.Path))).ToList();

            DefaultRepoProject = CreateRepoProject(GetRepoProjectName(repoName), repoRoot);
        }