Пример #1
0
        // Expected runtime name format: KRE-{FLAVOR}-{ARCHITECTURE}.{VERSION}
        // Sample input: KRE-CoreCLR-x86.1.0.0.0
        // Sample output: 1.0.0.0
        private static string GetRuntimeVersion(PackRuntime runtime)
        {
            if (runtime == null)
            {
                return(string.Empty);
            }

            var segments = runtime.Name.Split(new[] { '.' }, 2);

            return(segments[1]);
        }
Пример #2
0
        // Expected runtime name format: KRE-{FLAVOR}-{ARCHITECTURE}.{VERSION}
        // Sample input: KRE-CoreCLR-x86.1.0.0.0
        // Sample output: CoreCLR
        private static string GetRuntimeFlavor(PackRuntime runtime)
        {
            if (runtime == null)
            {
                return(string.Empty);
            }

            var segments = runtime.Name.Split(new[] { '.' }, 2);

            segments = segments[0].Split(new[] { '-' }, 3);
            return(segments[1]);
        }