Esempio n. 1
0
        /// <summary>
        /// Gets a list of versions installed with specific tier and platform
        /// </summary>
        /// <param name="tier">The tier</param>
        /// <returns>A list of installed versions</returns>
        public List <DarkRiftInstallation> GetVersions(ServerTier tier)
        {
            string searchPath = Path.Combine(installationDirectory, tier.ToString().ToLower());

            if (!fileUtility.DirectoryExists(searchPath))
            {
                return(new List <DarkRiftInstallation>());
            }
            else
            {
                return(fileUtility.GetDirectories(searchPath)
                       .SelectMany(path => fileUtility.GetDirectories(Path.Combine(searchPath, path))
                                   .Select(subPath => new DarkRiftInstallation(
                                               subPath,
                                               tier,
                                               path switch { "core" => "Core", "framework" => "Framework", _ => path },
Esempio n. 2
0
 /// <summary>
 /// Gets a list of versions installled
 /// </summary>
 /// <returns>A list of installed versions</returns>
 public List <DocumentationInstallation> GetVersions()
 {
     if (!fileUtility.DirectoryExists(installationDirectory))
     {
         return(new List <DocumentationInstallation>());
     }
     else
     {
         return(fileUtility.GetDirectories(installationDirectory)
                .Select(path => new DocumentationInstallation(path, Path.Combine(installationDirectory, path)))
                .ToList());
     }
 }
        /// <summary>
        /// Gets a list of versions installed with specific tier and platform
        /// </summary>
        /// <param name="tier">The tier</param>
        /// <param name="platform">The platform</param>
        /// <returns>A list of installed versions</returns>
        public List <DarkRiftInstallation> GetVersions(ServerTier tier, ServerPlatform platform)
        {
            string searchPath = Path.Combine(installationDirectory, tier.ToString().ToLower(), platform.ToString().ToLower());

            if (!fileUtility.DirectoryExists(searchPath))
            {
                return(new List <DarkRiftInstallation>());
            }
            else
            {
                return(fileUtility.GetDirectories(searchPath)
                       .Select(path => new DarkRiftInstallation(path, tier, platform, Path.Combine(searchPath, path)))
                       .ToList());
            }
        }