/// <summary>
        /// Updates the capabilities used by Microsoft's implementation of the
        /// HttpBrowserCapabilities class to control the property values it
        /// returns. Only properties exposed by FiftyOneBrowserCapabilities are overriden
        /// by this method.
        /// </summary>
        /// <param name="capabilities">Dictionary of capabilities to be enhanced.</param>
        /// <param name="currentCapabilities">Dictionary of existing capabilities for the device.</param>
        /// <param name="results">The match result to use for the enhancement.</param>
        private static void Enhance(
            IDictionary capabilities,
            HttpBrowserCapabilities currentCapabilities,
            SortedList<string, string[]> results)
        {
            // Set base capabilities for all mobile devices.
            SetStaticValues(capabilities);

            SetValue(capabilities, "isMobileDevice", GetIsMobileDevice(results));
            SetValue(capabilities, "crawler", GetIsCrawler(results));
            SetValue(capabilities, "mobileDeviceModel", GetMobileDeviceModel(results));
            SetValue(capabilities, "mobileDeviceManufacturer", GetMobileDeviceManufacturer(results));
            SetValue(capabilities, "platform", GetPlatform(results));
            // property enhancement can be removed with this compiler flag
            #if !REMOVE_OVERRIDE_BROWSER
            SetValue(capabilities, "browser", GetBrowser(results));
            #endif
            SetValue(capabilities, "type", capabilities["mobileDeviceManufacturer"]);
            SetValue(capabilities, "screenPixelsHeight", GetScreenPixelsHeight(results) ??
                GetDefaultValue("screenPixelsHeight", currentCapabilities));
            SetValue(capabilities, "screenPixelsWidth", GetScreenPixelsWidth(results) ??
                GetDefaultValue("screenPixelsWidth", currentCapabilities));
            SetValue(capabilities, "screenBitDepth", GetBitsPerPixel(results));
            SetValue(capabilities, "preferredImageMime", GetPreferredImageMime(results));
            SetValue(capabilities, "isColor", GetIsColor(results));
            SetValue(capabilities, "supportsCallback", GetSupportsCallback(results));
            SetValue(capabilities, "SupportsCallback", GetSupportsCallback(results));
            SetValue(capabilities, "canInitiateVoiceCall", GetIsMobileDevice(results));
            SetValue(capabilities, "jscriptversion", GetJavascriptVersion(results));

            // The following values are set to prevent exceptions being thrown in
            // the standard .NET base classes if the property is accessed.
            SetValue(capabilities, "screenCharactersHeight",
                GetDefaultValue("screenCharactersHeight", currentCapabilities));
            SetValue(capabilities, "screenCharactersWidth",
                GetDefaultValue("screenCharactersWidth", currentCapabilities));

            // Use the Version class to find the version. If this fails use the 1st two
            // decimal segments of the string.
            string versionValue = results.GetString("BrowserVersion");
            if (versionValue != null)
            {
            #if VER4
                Version version = null;
                if (Version.TryParse(versionValue, out version))
                {
                    SetVersion(capabilities, version);
                }
                else
                {
                    SetVersion(capabilities, versionValue.ToString());
                }
            #else
                try
                {
                    SetVersion(capabilities, new Version(versionValue));
                }
                catch (FormatException)
                {
                    SetVersion(capabilities, versionValue.ToString());
                }
                catch (ArgumentException)
                {
                    SetVersion(capabilities, versionValue.ToString());
                }
            #endif
            }
            else
            {
                // Transfer the current version capabilities to the new capabilities.
                SetValue(capabilities, "majorversion", currentCapabilities != null ? currentCapabilities["majorversion"] : null);
                SetValue(capabilities, "minorversion", currentCapabilities != null ? currentCapabilities["minorversion"] : null);
                SetValue(capabilities, "version", currentCapabilities != null ? currentCapabilities["version"] : null);

                // Ensure the version values are not null to prevent null arguement exceptions
                // with some controls.
                var versionString = currentCapabilities != null ? currentCapabilities["version"] as string : "0.0";
                SetVersion(capabilities, versionString);
            }

            // All we can determine from the device database is if javascript is supported as a boolean.
            // If the value is not provided then null is returned and the capabilities won't be altered.
            var javaScript = GetJavascriptSupport(results);
            if (javaScript.HasValue)
            {
                SetJavaScript(capabilities, javaScript.Value);
                SetValue(capabilities, "ecmascriptversion",
                         (bool)javaScript ? "3.0" : "0.0");
            }

            // Sets the W3C DOM version.
            SetValue(capabilities, "w3cdomversion",
                GetW3CDOMVersion(results,
                    currentCapabilities != null
                        ? (string)currentCapabilities["w3cdomversion"]
                        : String.Empty));

            // Update the cookies value if we have additional information.
            SetValue(capabilities, "cookies",
                    GetCookieSupport(results,
                                     currentCapabilities != null
                                         ? (string)currentCapabilities["cookies"]
                                         : String.Empty));

            // Only set these values from 51Degrees.mobi if they've not already been set from
            // the Http request header, or the .NET solution.
            if (capabilities.Contains("preferredRenderingType") == false)
            {
                // Set the rendering type for the response.
                SetValue(capabilities, "preferredRenderingType", GetPreferredHtmlVersion(results));

                // Set the Mime type of the response.
                SetValue(capabilities, "preferredRenderingMime", "text/html");
            }
        }