private static NetPortableProfileCollection BuildPortableProfileCollection()
        {
            var profileCollection = new NetPortableProfileCollection();

            profileCollection.AddRange(LoadProfilesFromFramework("v4.0"));
            profileCollection.AddRange(LoadProfilesFromFramework("v4.5"));

            return(profileCollection);
        }
Exemple #2
0
        private static NetPortableProfileCollection BuildPortableProfileCollection()
        {
            var profileCollection = new NetPortableProfileCollection();

            string portableRootDirectory;

            string portableReferencePathOverride = Environment.GetEnvironmentVariable(PortableReferenceAssemblyPathEnvironmentVariableName);

            if (!string.IsNullOrEmpty(portableReferencePathOverride))
            {
                portableRootDirectory = portableReferencePathOverride;
            }
            else
            {
                portableRootDirectory =
                    Path.Combine(
                        Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify),
                        @"Reference Assemblies\Microsoft\Framework\.NETPortable");
            }

            if (Directory.Exists(portableRootDirectory))
            {
                foreach (string versionDir in Directory.EnumerateDirectories(portableRootDirectory, "v*", SearchOption.TopDirectoryOnly))
                {
                    string profileFilesPath = versionDir + @"\Profile\";
                    profileCollection.AddRange(LoadProfilesFromFramework(versionDir, profileFilesPath));
                }
            }

            return(profileCollection);
        }
        private static NetPortableProfileCollection BuildPortableProfileCollection()
        {
            var profileCollection = new NetPortableProfileCollection();

            string portableRootDirectory;

            string portableReferencePathOverride = Environment.GetEnvironmentVariable(PortableReferenceAssemblyPathEnvironmentVariableName);

            if (!string.IsNullOrEmpty(portableReferencePathOverride))
            {
                portableRootDirectory = portableReferencePathOverride;
            }
            else
            {
                portableRootDirectory = GetPortableRootDirectory();
            }

            if (Directory.Exists(portableRootDirectory))
            {
                foreach (string versionDir in Directory.EnumerateDirectories(portableRootDirectory, "v*", SearchOption.TopDirectoryOnly))
                {
                    string profileFilesPath = Path.Combine(versionDir, "Profile");
                    profileCollection.AddRange(LoadProfilesFromFramework(versionDir, profileFilesPath));
                }
            }

            return(profileCollection);
        }
        public NetPortableProfileTable(IEnumerable <NetPortableProfile> profiles)
        {
            Profiles = new NetPortableProfileCollection();
            Profiles.AddRange(profiles);

            // Index profiles
            _portableProfilesByCustomProfileString = Profiles.ToDictionary(p => p.CustomProfileString);
            CreateOptionalFrameworksDictionary();
        }
        private static NetPortableProfileCollection BuildPortableProfileCollection()
        {
            var profileCollection = new NetPortableProfileCollection();

#if DESKTOP // CORECLR_TODO: Environment.GetFolderPath
            string portableRootDirectory =
                Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify),
                    @"Reference Assemblies\Microsoft\Framework\.NETPortable");

            if (Directory.Exists(portableRootDirectory))
            {
                foreach (string versionDir in Directory.EnumerateDirectories(portableRootDirectory, "v*", SearchOption.TopDirectoryOnly))
                {
                    string profileFilesPath = versionDir + @"\Profile\";
                    profileCollection.AddRange(LoadProfilesFromFramework(versionDir, profileFilesPath));
                }
            }
#endif

            return(profileCollection);
        }
        private static NetPortableProfileCollection BuildPortableProfileCollection()
        {
            var profileCollection = new NetPortableProfileCollection();

            var referenceAssembliesPath = FrameworkReferenceResolver.GetReferenceAssembliesPath();

            if (!string.IsNullOrEmpty(referenceAssembliesPath))
            {
                string portableRootDirectory = Path.Combine(referenceAssembliesPath, ".NETPortable");

                if (Directory.Exists(portableRootDirectory))
                {
                    foreach (string versionDir in Directory.EnumerateDirectories(portableRootDirectory, "v*", SearchOption.TopDirectoryOnly))
                    {
                        string profileFilesPath = Path.Combine(versionDir, "Profile");
                        profileCollection.AddRange(LoadProfilesFromFramework(versionDir, profileFilesPath));
                    }
                }
            }

            return(profileCollection);
        }