Exemplo n.º 1
0
        public FrameworkPaths(FrameworkPath[] paths)
        {
            var firstPath = paths[0];

#if DEBUG
            for (int i = 1; i < paths.Length; i++)
            {
                if (firstPath.Bitness != paths[i].Bitness)
                {
                    throw new ArgumentException();
                }
                // Ignore Extra since it can be different if it's a preview
                if (firstPath.Version.Major != paths[i].Version.Major ||
                    firstPath.Version.Minor != paths[i].Version.Minor ||
                    firstPath.Version.Patch != paths[i].Version.Patch)
                {
                    throw new ArgumentException();
                }
            }
#endif
            var allPaths = paths.Select(a => a.Path).ToArray();
            Array.Sort(allPaths, SortPaths);
            Paths         = allPaths;
            Bitness       = firstPath.Bitness;
            Version       = firstPath.Version;
            SystemVersion = new Version(firstPath.Version.Major, firstPath.Version.Minor, firstPath.Version.Patch, 0);

            foreach (var p in Paths)
            {
                if (StringComparer.OrdinalIgnoreCase.Equals(Path.GetFileName(Path.GetDirectoryName(p)),
                                                            DotNetCoreAppDir))
                {
                    HasDotNetCoreAppPath = true;
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public FrameworkVersionIgnoreExtra(FrameworkVersion version) => this.version = version;
Exemplo n.º 3
0
 public FrameworkPath(string path, int bitness, FrameworkVersion version)
 {
     Path    = path ?? throw new ArgumentNullException(nameof(path));
     Bitness = bitness;
     Version = version;
 }