Beispiel #1
0
        /// <summary>
        /// Determines if two runtime identifiers are compatible, based on the import graph
        /// </summary>
        /// <param name="criteria">The criteria being tested</param>
        /// <param name="provided">The value the criteria is being tested against</param>
        /// <returns>
        /// true if an asset for the runtime in <paramref name="provided" /> can be installed in a project
        /// targetting <paramref name="criteria" />, false otherwise
        /// </returns>
        public bool AreCompatible(string criteria, string provided)
        {
            // Identical runtimes are compatible
            if (StringComparer.Ordinal.Equals(criteria, provided))
            {
                return(true);
            }

            var key = new RuntimeCompatKey(criteria, provided);

            return(_areCompatible.GetOrAdd(key, k => AreCompatibleInternal(k)));
        }
Beispiel #2
0
 private bool AreCompatibleInternal(RuntimeCompatKey key)
 {
     return(ExpandRuntimeCached(key.RuntimeName).Contains(key.Other));
 }