Esempio n. 1
0
        /// <summary>
        /// Determines if the specified .NET Framework Foundation Library is
        /// installed on the local computer.
        /// </summary>
        /// <param name="foundationLibrary">One of the
        /// <see cref="WindowsFoundationLibrary"/> values.</param>
        /// <returns><see langword="true"/> if the specified .NET Framework
        /// Foundation Library is installed; otherwise <see langword="false"/>.</returns>
        public static bool IsInstalled(WindowsFoundationLibrary foundationLibrary)
        {
            bool ret = false;

            switch (foundationLibrary)
            {
            case WindowsFoundationLibrary.CardSpace:
                ret = IsNetfx30CardSpaceInstalled();
                break;

            case WindowsFoundationLibrary.WCF:
                ret = IsNetfx30WCFInstalled();
                break;

            case WindowsFoundationLibrary.WF:
                ret = IsNetfx30WFInstalled();
                break;

            case WindowsFoundationLibrary.WPF:
                ret = IsNetfx30WPFInstalled();
                break;

            default:
                break;
            }

            return(ret);
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieves the service pack level for the specified .NET Framework
        /// Foundation Library.
        /// </summary>
        /// <param name="foundationLibrary">One of the
        /// <see cref="WindowsFoundationLibrary"/> values.</param>
        /// <returns>An <see cref="Int32">integer</see> value representing
        /// the service pack level for the specified .NET Framework Foundation
        /// Library. If the specified .NET Frameowrk Foundation Library is not
        /// found, -1 is returned.
        /// </returns>
        public static int GetServicePackLevel(WindowsFoundationLibrary foundationLibrary)
        {
            int servicePackLevel = -1;

            switch (foundationLibrary)
            {
            case WindowsFoundationLibrary.CardSpace:
                servicePackLevel = GetNetfx30CardSpaceSPLevel();
                break;

            case WindowsFoundationLibrary.WCF:
                servicePackLevel = GetNetfx30WCFSPLevel();
                break;

            case WindowsFoundationLibrary.WF:
                servicePackLevel = GetNetfx30WFSPLevel();
                break;

            case WindowsFoundationLibrary.WPF:
                servicePackLevel = GetNetfx30WPFSPLevel();
                break;

            default:
                break;
            }

            return(servicePackLevel);
        }
Esempio n. 3
0
        /// <summary>
        /// Retrieves the exact version number for the specified .NET Framework
        /// Foundation Library.
        /// </summary>
        /// <param name="foundationLibrary">One of the
        /// <see cref="WindowsFoundationLibrary"/> values.</param>
        /// <returns>A <see cref="Version">version</see> representing
        /// the exact version number for the specified .NET Framework Foundation
        /// Library. If the specified .NET Frameowrk Foundation Library is not
        /// found, a <see cref="Version"/> is returned that represents a
        /// 0.0.0.0 version number.
        /// </returns>
        public static Version GetExactVersion(WindowsFoundationLibrary foundationLibrary)
        {
            Version fxVersion = new Version();

            switch (foundationLibrary)
            {
            case WindowsFoundationLibrary.CardSpace:
                fxVersion = GetNetfx30CardSpaceExactVersion();
                break;

            case WindowsFoundationLibrary.WCF:
                fxVersion = GetNetfx30WCFExactVersion();
                break;

            case WindowsFoundationLibrary.WF:
                fxVersion = GetNetfx30WFExactVersion();
                break;

            case WindowsFoundationLibrary.WPF:
                fxVersion = GetNetfx30WPFExactVersion();
                break;

            default:
                break;
            }

            return(fxVersion);
        }