Exemple #1
0
 public FrameworkData(Runtime runtime, Version frameworkVersion, Version clrVersion,
                      string representation, string displayName, string frameworkName)
 {
     this.runtime          = runtime;
     this.frameworkVersion = frameworkVersion;
     this.clrVersion       = clrVersion;
     this.representation   = representation;
     this.displayName      = displayName;
     this.frameworkName    = frameworkName != null
         ? new FrameworkName(frameworkName)
         : null;
 }
        /// <summary>
        /// Construct from a runtime type, version and profile. The version
        /// may be either a framework version or a CLR version. If a CLR
        /// version is provided, we try to deduce the framework version but
        /// this may not always be successful, in which case a version of
        /// 0.0 is used.
        /// </summary>
        /// <param name="runtime">The runtime type of the framework.</param>
        /// <param name="version">The version of the framework.</param>
        /// <param name="profile">The profile of the framework. Null if unspecified.</param>
        public RuntimeFramework(Runtime runtime, Version version, string profile)
        {
            Runtime          = runtime;
            FrameworkVersion = version;
            ClrVersion       = runtime.GetClrVersionForFramework(version);

            Profile = profile;

            DisplayName = GetDefaultDisplayName(Runtime, FrameworkVersion, profile);

            FrameworkName = new FrameworkName(Runtime.FrameworkIdentifier, FrameworkVersion);
        }
Exemple #3
0
        /// <summary>
        /// Construct from a runtime type, version and profile. The version
        /// may be either a framework version or a CLR version. If a CLR
        /// version is provided, we try to deduce the framework version but
        /// this may not always be successful, in which case a version of
        /// 0.0 is used.
        /// </summary>
        /// <param name="runtime">The runtime type of the framework.</param>
        /// <param name="version">The version of the framework.</param>
        /// <param name="profile">The profile of the framework. Null if unspecified.</param>
        public RuntimeFramework(Runtime runtime, Version version, string profile)
        {
            Runtime          = runtime;
            FrameworkVersion = ClrVersion = version;

            if (IsFrameworkVersion(version))
            {
                ClrVersion = GetClrVersionForFramework(version);
            }
            else
            {
                FrameworkVersion = GetFrameworkVersionForClr(version);
            }

            Profile = profile;

            DisplayName = GetDefaultDisplayName(Runtime, FrameworkVersion, profile);

            FrameworkName = new FrameworkName(Runtime.FrameworkIdentifier, FrameworkVersion);
        }
 public static RuntimeFramework FromFrameworkName(FrameworkName frameworkName)
 {
     return(new RuntimeFramework(Runtime.FromFrameworkIdentifier(frameworkName.Identifier), frameworkName.Version, frameworkName.Profile));
 }