Ejemplo n.º 1
0
        public static async Task <List <LocationDetails> > GetMultiTermFoldersPath(
            string userName,
            List <MultiTermVersionListItem> multiTermVersions,
            List <MultiTermLocationListItem> locations)
        {
            var foldersLocationList = new List <LocationDetails>();

            try
            {
                foreach (var location in locations)
                {
                    if (location.Alias != null)
                    {
                        if (location.Alias.Equals("packageCache"))
                        {
                            var packageCacheLocations = await Task.FromResult(MultiTermFolders.GetPackageCachePaths(multiTermVersions));

                            foldersLocationList.AddRange(packageCacheLocations);
                        }
                        if (location.Alias.Equals("programFiles"))
                        {
                            var programFilesLocations = await Task.FromResult(MultiTermFolders.ProgramFilesPaths(multiTermVersions));

                            foldersLocationList.AddRange(programFilesLocations);
                        }
                        if (location.Alias.Equals("appDataLocal"))
                        {
                            var appDataLocal = await Task.FromResult(MultiTermFolders.AppDataLocalPaths(userName, multiTermVersions));

                            foldersLocationList.AddRange(appDataLocal);
                        }
                        if (location.Alias.Equals("appDataRoming"))
                        {
                            var appDataRoaming = await Task.FromResult(MultiTermFolders.AppDataRoamingPaths(userName, multiTermVersions));

                            foldersLocationList.AddRange(appDataRoaming);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"{Constants.GetMultiTermFoldersPath} {ex.Message}\n {ex.StackTrace}");
            }
            return(foldersLocationList);
        }
Ejemplo n.º 2
0
        public static async Task <List <LocationDetails> > GetMultiTermFoldersPath(string userName,
                                                                                   List <MultiTermVersionListItem> multiTermVersions, List <MultiTermLocationListItem> locations)
        {
            var foldersLocationList = new List <LocationDetails>();

            foreach (var location in locations)
            {
                if (location.Alias != null)
                {
                    if (location.Alias.Equals("packageCache"))
                    {
                        var packageCacheLocations = await Task.FromResult(MultiTermFolders.GetPackageCachePaths(location, multiTermVersions));

                        foldersLocationList.AddRange(packageCacheLocations);
                    }
                    if (location.Alias.Equals("programFiles"))
                    {
                        var programFilesLocations = await Task.FromResult(MultiTermFolders.ProgramFilesPaths(location, multiTermVersions));

                        foldersLocationList.AddRange(programFilesLocations);
                    }
                    if (location.Alias.Equals("appDataLocal"))
                    {
                        var appDataLocal = await Task.FromResult(MultiTermFolders.AppDataLocalPaths(location, userName, multiTermVersions));

                        foldersLocationList.AddRange(appDataLocal);
                    }
                    if (location.Alias.Equals("appDataRoming"))
                    {
                        var appDataRoaming = await Task.FromResult(MultiTermFolders.AppDataRoamingPaths(location, userName, multiTermVersions));

                        foldersLocationList.AddRange(appDataRoaming);
                    }
                }
            }
            return(foldersLocationList);
        }