BrowserCapabilitiesFactory.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / BrowserCapabilitiesFactory.cs / 1305376 / BrowserCapabilitiesFactory.cs

                            //------------------------------------------------------------------------------ 
// 
//     This code was generated by a tool.
//     Runtime Version:4.0.20624.0
// 
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated. 
//  
//-----------------------------------------------------------------------------
 
namespace System.Web.Configuration {

    using System.Diagnostics.CodeAnalysis;
 
    public class BrowserCapabilitiesFactory : System.Web.Configuration.BrowserCapabilitiesFactoryBase {
 
        public override void ConfigureBrowserCapabilities(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            this.DefaultProcess(headers, browserCaps);
            if ((this.IsBrowserUnknown(browserCaps) == false)) { 
                return;
            }
            this.DefaultDefaultProcess(headers, browserCaps);
        } 

        protected virtual void IeProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        } 

        protected virtual void IeProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }

        private bool IeProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches 
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "MSIE (?\'version\'(?\'major\'\\d+)(\\.(?\'minor\'\\d+)?)(?\'letters\'\\w*))(?\'extra\'[^)]*)");
            if ((result == false)) { 
                return false;
            } 
            headerValue = ((string)(browserCaps[string.Empty])); 
            result = regexWorker.ProcessRegex(headerValue, "IEMobile");
            if ((result == true)) { 
                return false;
            }
            // Capture: header values
            regexWorker.ProcessRegex(((string)(browserCaps[string.Empty])), "Trident/(?\'layoutVersion\'\\d+)"); 
            // Capabilities: set capabilities
            dictionary["browser"] = "IE"; 
            dictionary["layoutEngine"] = "Trident"; 
            dictionary["layoutEngineVersion"] = regexWorker["${layoutVersion}"];
            dictionary["extra"] = regexWorker["${extra}"]; 
            dictionary["isColor"] = "true";
            dictionary["letters"] = regexWorker["${letters}"];
            dictionary["majorversion"] = regexWorker["${major}"];
            dictionary["minorversion"] = regexWorker["${minor}"]; 
            dictionary["screenBitDepth"] = "8";
            dictionary["type"] = regexWorker["IE${major}"]; 
            dictionary["version"] = regexWorker["${version}"]; 
            browserCaps.AddBrowser("IE");
            this.IeProcessGateways(headers, browserCaps); 
            // gateway, parent=IE
            this.IebetaProcess(headers, browserCaps);
            bool ignoreApplicationBrowsers = true;
            // browser, parent=IE 
            if (this.Ie6to9Process(headers, browserCaps)) {
            } 
            else { 
                ignoreApplicationBrowsers = false;
            } 
            this.IeProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void Ie6to9ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void Ie6to9ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Ie6to9Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check capability matches
            string headerValue; 
            headerValue = ((string)(dictionary["majorversion"])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "[6-9]");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["ecmascriptversion"] = "3.0"; 
            dictionary["jscriptversion"] = "5.6";
            dictionary["javascript"] = "true"; 
            dictionary["javascriptversion"] = "1.5";
            dictionary["msdomversion"] = regexWorker["${majorversion}.${minorversion}"];
            dictionary["w3cdomversion"] = "1.0";
            dictionary["ExchangeOmaSupported"] = "true"; 
            dictionary["activexcontrols"] = "true";
            dictionary["backgroundsounds"] = "true"; 
            dictionary["cookies"] = "true"; 
            dictionary["frames"] = "true";
            dictionary["javaapplets"] = "true"; 
            dictionary["supportsCallback"] = "true";
            dictionary["supportsFileUpload"] = "true";
            dictionary["supportsMultilineTextBoxDisplay"] = "true";
            dictionary["supportsMaintainScrollPositionOnPostback"] = "true"; 
            dictionary["supportsVCard"] = "true";
            dictionary["supportsXmlHttp"] = "true"; 
            dictionary["tables"] = "true"; 
            dictionary["supportsAccessKeyAttribute"] = "true";
            dictionary["tagwriter"] = "System.Web.UI.HtmlTextWriter"; 
            dictionary["vbscript"] = "true";
            browserCaps.AddBrowser("IE6to9");
            this.Ie6to9ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = true; 
            // browser, parent=IE6to9
            if (this.Ie7Process(headers, browserCaps)) { 
            } 
            else {
                if (this.Ie8Process(headers, browserCaps)) { 
                }
                else {
                    ignoreApplicationBrowsers = false;
                } 
            }
            this.Ie6to9ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void Ie7ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void Ie7ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool Ie7Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check capability matches
            string headerValue;
            headerValue = ((string)(dictionary["majorversion"]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "7"); 
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities
            dictionary["jscriptversion"] = "5.7";
            browserCaps.AddBrowser("IE7"); 
            this.Ie7ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Ie7ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 

        protected virtual void Ie8ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }
 
        protected virtual void Ie8ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        private bool Ie8Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check capability matches
            string headerValue;
            headerValue = ((string)(dictionary["majorversion"])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "8");
            if ((result == false)) { 
                return false;
            }
            // Capabilities: set capabilities
            dictionary["jscriptversion"] = "6.0"; 
            browserCaps.AddBrowser("IE8");
            this.Ie8ProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false; 
            this.Ie8ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }

        protected virtual void IebetaProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        protected virtual void IebetaProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        } 

        private bool IebetaProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities;
            // Identification: check capability matches
            string headerValue; 
            headerValue = ((string)(dictionary["letters"]));
            bool result; 
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "^([bB]|ab)"); 
            if ((result == false)) {
                return false;
            }
            // Capabilities: set capabilities 
            dictionary["beta"] = "true";
            this.IebetaProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false; 
            this.IebetaProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }

        protected virtual void BlackberryProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        protected virtual void BlackberryProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        } 

        private bool BlackberryProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result; 
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "BlackBerry(?\'deviceName\'\\w+)/(?\'version\'(?\'major\'\\d+)(\\.(?\'minor\'\\d+)?)\\w*)"); 
            if ((result == false)) {
                return false;
            }
            // Capabilities: set capabilities 
            dictionary["layoutEngine"] = "BlackBerry";
            dictionary["browser"] = "BlackBerry"; 
            dictionary["majorversion"] = regexWorker["${major}"]; 
            dictionary["minorversion"] = regexWorker["${minor}"];
            dictionary["type"] = regexWorker["BlackBerry${major}"]; 
            dictionary["mobileDeviceModel"] = regexWorker["${deviceName}"];
            dictionary["isMobileDevice"] = "true";
            dictionary["version"] = regexWorker["${version}"];
            dictionary["ecmascriptversion"] = "3.0"; 
            dictionary["javascript"] = "true";
            dictionary["javascriptversion"] = "1.3"; 
            dictionary["w3cdomversion"] = "1.0"; 
            dictionary["supportsAccesskeyAttribute"] = "true";
            dictionary["tagwriter"] = "System.Web.UI.HtmlTextWriter"; 
            dictionary["cookies"] = "true";
            dictionary["frames"] = "true";
            dictionary["javaapplets"] = "true";
            dictionary["supportsCallback"] = "true"; 
            dictionary["supportsDivNoWrap"] = "false";
            dictionary["supportsFileUpload"] = "true"; 
            dictionary["supportsMultilineTextBoxDisplay"] = "true"; 
            dictionary["supportsXmlHttp"] = "true";
            dictionary["tables"] = "true"; 
            dictionary["canInitiateVoiceCall"] = "true";
            browserCaps.AddBrowser("BlackBerry");
            this.BlackberryProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.BlackberryProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        } 

        protected virtual void OperaProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }

        protected virtual void OperaProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool OperaProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Opera[ /](?\'version\'(?\'major\'\\d+)(\\.(?\'minor\'\\d+)?)(?\'letters\'\\w*))"); 
            if ((result == false)) { 
                return false;
            } 
            // Capture: header values
            regexWorker.ProcessRegex(((string)(browserCaps[string.Empty])), "Presto/(?\'layoutVersion\'\\d+)");
            // Capabilities: set capabilities
            dictionary["browser"] = "Opera"; 
            dictionary["majorversion"] = regexWorker["${major}"];
            dictionary["minorversion"] = regexWorker["${minor}"]; 
            dictionary["type"] = regexWorker["Opera${major}"]; 
            dictionary["version"] = regexWorker["${version}"];
            dictionary["layoutEngine"] = "Presto"; 
            dictionary["layoutEngineVersion"] = regexWorker["${layoutVersion}"];
            dictionary["ecmascriptversion"] = "3.0";
            dictionary["javascript"] = "true";
            dictionary["javascriptversion"] = "1.5"; 
            dictionary["letters"] = regexWorker["${letters}"];
            dictionary["w3cdomversion"] = "1.0"; 
            dictionary["tagwriter"] = "System.Web.UI.HtmlTextWriter"; 
            dictionary["cookies"] = "true";
            dictionary["frames"] = "true"; 
            dictionary["javaapplets"] = "true";
            dictionary["supportsAccesskeyAttribute"] = "true";
            dictionary["supportsCallback"] = "true";
            dictionary["supportsFileUpload"] = "true"; 
            dictionary["supportsMultilineTextBoxDisplay"] = "true";
            dictionary["supportsXmlHttp"] = "true"; 
            dictionary["tables"] = "true"; 
            dictionary["inputType"] = "keyboard";
            dictionary["isColor"] = "true"; 
            dictionary["isMobileDevice"] = "false";
            dictionary["maximumRenderedPageSize"] = "300000";
            dictionary["screenBitDepth"] = "8";
            dictionary["supportsBold"] = "true"; 
            dictionary["supportsCss"] = "true";
            dictionary["supportsDivNoWrap"] = "true"; 
            dictionary["supportsFontName"] = "true"; 
            dictionary["supportsFontSize"] = "true";
            dictionary["supportsImageSubmit"] = "true"; 
            dictionary["supportsItalic"] = "true";
            browserCaps.AddBrowser("Opera");
            this.OperaProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = true; 
            // browser, parent=Opera
            if (this.Opera8to9Process(headers, browserCaps)) { 
            } 
            else {
                if (this.Opera10Process(headers, browserCaps)) { 
                }
                else {
                    ignoreApplicationBrowsers = false;
                } 
            }
            this.OperaProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void Opera8to9ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void Opera8to9ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool Opera8to9Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check capability matches
            string headerValue;
            headerValue = ((string)(dictionary["majorversion"]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "[8-9]"); 
            if ((result == false)) {
                return false; 
            }
            headerValue = ((string)(dictionary["Version"]));
            result = regexWorker.ProcessRegex(headerValue, "9.80");
            if ((result == true)) { 
                return false;
            } 
            // Capabilities: set capabilities 
            dictionary["supportsMaintainScrollPositionOnPostback"] = "true";
            browserCaps.AddBrowser("Opera8to9"); 
            this.Opera8to9ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false;
            this.Opera8to9ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        protected virtual void Opera10ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        protected virtual void Opera10ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        private bool Opera10Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Opera/10\\.|Version/10\\."); 
            if ((result == false)) {
                return false; 
            } 
            // Capabilities: set capabilities
            dictionary["version"] = "10.00"; 
            dictionary["majorversion"] = "10";
            dictionary["minorversion"] = "00";
            dictionary["supportsMaintainScrollPositionOnPostback"] = "true";
            browserCaps.AddBrowser("Opera10"); 
            this.Opera10ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Opera10ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 

        protected virtual void ChromeProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }
 
        protected virtual void ChromeProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        private bool ChromeProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "Chrome/(?\'version\'(?\'major\'\\d+)(\\.(?\'minor\'\\d+)?)\\w*)");
            if ((result == false)) { 
                return false;
            }
            // Capture: header values
            regexWorker.ProcessRegex(((string)(browserCaps[string.Empty])), "AppleWebKit/(?\'layoutVersion\'\\d+)"); 
            // Capabilities: set capabilities
            dictionary["layoutEngine"] = "WebKit"; 
            dictionary["layoutEngineVersion"] = regexWorker["${layoutVersion}"]; 
            dictionary["browser"] = "Chrome";
            dictionary["majorversion"] = regexWorker["${major}"]; 
            dictionary["minorversion"] = regexWorker["${minor}"];
            dictionary["type"] = regexWorker["Chrome${major}"];
            dictionary["version"] = regexWorker["${version}"];
            dictionary["ecmascriptversion"] = "3.0"; 
            dictionary["javascript"] = "true";
            dictionary["javascriptversion"] = "1.7"; 
            dictionary["w3cdomversion"] = "1.0"; 
            dictionary["supportsAccesskeyAttribute"] = "true";
            dictionary["tagwriter"] = "System.Web.UI.HtmlTextWriter"; 
            dictionary["cookies"] = "true";
            dictionary["frames"] = "true";
            dictionary["javaapplets"] = "true";
            dictionary["supportsCallback"] = "true"; 
            dictionary["supportsDivNoWrap"] = "false";
            dictionary["supportsFileUpload"] = "true"; 
            dictionary["supportsMaintainScrollPositionOnPostback"] = "true"; 
            dictionary["supportsMultilineTextBoxDisplay"] = "true";
            dictionary["supportsXmlHttp"] = "true"; 
            dictionary["tables"] = "true";
            browserCaps.AddBrowser("Chrome");
            this.ChromeProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.ChromeProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        } 

        protected virtual void DefaultProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }

        protected virtual void DefaultProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool DefaultProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Capabilities: set capabilities 
            dictionary["activexcontrols"] = "false";
            dictionary["aol"] = "false";
            dictionary["backgroundsounds"] = "false";
            dictionary["beta"] = "false"; 
            dictionary["browser"] = "Unknown";
            dictionary["canCombineFormsInDeck"] = "true"; 
            dictionary["canInitiateVoiceCall"] = "false"; 
            dictionary["canRenderAfterInputOrSelectElement"] = "true";
            dictionary["canRenderEmptySelects"] = "true"; 
            dictionary["canRenderInputAndSelectElementsTogether"] = "true";
            dictionary["canRenderMixedSelects"] = "true";
            dictionary["canRenderOneventAndPrevElementsTogether"] = "true";
            dictionary["canRenderPostBackCards"] = "true"; 
            dictionary["canRenderSetvarZeroWithMultiSelectionList"] = "true";
            dictionary["canSendMail"] = "true"; 
            dictionary["cdf"] = "false"; 
            dictionary["cookies"] = "true";
            dictionary["crawler"] = "false"; 
            dictionary["defaultSubmitButtonLimit"] = "1";
            dictionary["ecmascriptversion"] = "0.0";
            dictionary["frames"] = "false";
            dictionary["gatewayMajorVersion"] = "0"; 
            dictionary["gatewayMinorVersion"] = "0";
            dictionary["gatewayVersion"] = "None"; 
            dictionary["hasBackButton"] = "true"; 
            dictionary["hidesRightAlignedMultiselectScrollbars"] = "false";
            dictionary["inputType"] = "telephoneKeypad"; 
            dictionary["isColor"] = "false";
            dictionary["isMobileDevice"] = "false";
            dictionary["javaapplets"] = "false";
            dictionary["jscriptversion"] = "0.0"; 
            dictionary["javascript"] = "false";
            dictionary["majorversion"] = "0"; 
            dictionary["maximumHrefLength"] = "10000"; 
            dictionary["maximumRenderedPageSize"] = "2000";
            dictionary["maximumSoftkeyLabelLength"] = "5"; 
            dictionary["minorversion"] = "0";
            dictionary["mobileDeviceManufacturer"] = "Unknown";
            dictionary["mobileDeviceModel"] = "Unknown";
            dictionary["msdomversion"] = "0.0"; 
            dictionary["numberOfSoftkeys"] = "0";
            dictionary["platform"] = "Unknown"; 
            dictionary["preferredImageMime"] = "image/gif"; 
            dictionary["preferredRenderingMime"] = "text/html";
            dictionary["preferredRenderingType"] = "html32"; 
            dictionary["rendersBreakBeforeWmlSelectAndInput"] = "false";
            dictionary["rendersBreaksAfterHtmlLists"] = "true";
            dictionary["rendersBreaksAfterWmlAnchor"] = "false";
            dictionary["rendersBreaksAfterWmlInput"] = "false"; 
            dictionary["rendersWmlDoAcceptsInline"] = "true";
            dictionary["rendersWmlSelectsAsMenuCards"] = "false"; 
            dictionary["requiredMetaTagNameValue"] = ""; 
            dictionary["requiresAbsolutePostbackUrl"] = "false";
            dictionary["requiresAdaptiveErrorReporting"] = "false"; 
            dictionary["requiresAttributeColonSubstitution"] = "false";
            dictionary["requiresContentTypeMetaTag"] = "false";
            dictionary["requiresControlStateInSession"] = "false";
            dictionary["requiresDBCSCharacter"] = "false"; 
            dictionary["requiresFullyQualifiedRedirectUrl"] = "false";
            dictionary["requiresLeadingPageBreak"] = "false"; 
            dictionary["requiresNoBreakInFormatting"] = "false"; 
            dictionary["requiresOutputOptimization"] = "false";
            dictionary["requiresPhoneNumbersAsPlainText"] = "false"; 
            dictionary["requiresPostRedirectionHandling"] = "false";
            dictionary["requiresSpecialViewStateEncoding"] = "false";
            dictionary["requiresUniqueFilePathSuffix"] = "false";
            dictionary["requiresUniqueHtmlCheckboxNames"] = "false"; 
            dictionary["requiresUniqueHtmlInputNames"] = "false";
            dictionary["requiresUrlEncodedPostfieldValues"] = "false"; 
            dictionary["requiresXhtmlCssSuppression"] = "false"; 
            dictionary["screenBitDepth"] = "1";
            dictionary["supportsAccesskeyAttribute"] = "false"; 
            dictionary["supportsBodyColor"] = "true";
            dictionary["supportsBold"] = "false";
            dictionary["supportsCallback"] = "false";
            dictionary["supportsCacheControlMetaTag"] = "true"; 
            dictionary["supportsCss"] = "false";
            dictionary["supportsDivAlign"] = "true"; 
            dictionary["supportsDivNoWrap"] = "false"; 
            dictionary["supportsEmptyStringInCookieValue"] = "true";
            dictionary["supportsFileUpload"] = "false"; 
            dictionary["supportsFontColor"] = "true";
            dictionary["supportsFontName"] = "false";
            dictionary["supportsFontSize"] = "false";
            dictionary["supportsImageSubmit"] = "false"; 
            dictionary["supportsIModeSymbols"] = "false";
            dictionary["supportsInputIStyle"] = "false"; 
            dictionary["supportsInputMode"] = "false"; 
            dictionary["supportsItalic"] = "false";
            dictionary["supportsJPhoneMultiMediaAttributes"] = "false"; 
            dictionary["supportsJPhoneSymbols"] = "false";
            dictionary["SupportsMaintainScrollPositionOnPostback"] = "false";
            dictionary["supportsMultilineTextBoxDisplay"] = "false";
            dictionary["supportsQueryStringInFormAction"] = "true"; 
            dictionary["supportsRedirectWithCookie"] = "true";
            dictionary["supportsSelectMultiple"] = "true"; 
            dictionary["supportsUncheck"] = "true"; 
            dictionary["supportsVCard"] = "false";
            dictionary["tables"] = "false"; 
            dictionary["tagwriter"] = "System.Web.UI.Html32TextWriter";
            dictionary["type"] = "Unknown";
            dictionary["vbscript"] = "false";
            dictionary["version"] = "0.0"; 
            dictionary["w3cdomversion"] = "0.0";
            dictionary["win16"] = "false"; 
            dictionary["win32"] = "false"; 
            browserCaps.AddBrowser("Default");
            this.DefaultProcessGateways(headers, browserCaps); 
            // gateway, parent=Default
            this.CrawlerProcess(headers, browserCaps);
            // gateway, parent=Default
            this.PlatformProcess(headers, browserCaps); 
            // gateway, parent=Default
            this.WinProcess(headers, browserCaps); 
            bool ignoreApplicationBrowsers = true; 
            // browser, parent=Default
            if (this.BlackberryProcess(headers, browserCaps)) { 
            }
            else {
                if (this.OperaProcess(headers, browserCaps)) {
                } 
                else {
                    if (this.GenericdownlevelProcess(headers, browserCaps)) { 
                    } 
                    else {
                        if (this.MozillaProcess(headers, browserCaps)) { 
                        }
                        else {
                            ignoreApplicationBrowsers = false;
                        } 
                    }
                } 
            } 
            this.DefaultProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }

        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process Firefox gateways.")]
        protected virtual void FirefoxProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process Firefox browsers.")] 
        protected virtual void FirefoxProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool FirefoxProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Firefox\\/(?\'version\'(?\'major\'\\d+)(\\.(?\'minor\'\\d+)?)\\w*)");
            if ((result == false)) {
                return false; 
            }
            // Capture: header values 
            regexWorker.ProcessRegex(((string)(browserCaps[string.Empty])), "Gecko/(?\'layoutVersion\'\\d+)"); 
            // Capabilities: set capabilities
            dictionary["browser"] = "Firefox"; 
            dictionary["majorversion"] = regexWorker["${major}"];
            dictionary["minorversion"] = regexWorker["${minor}"];
            dictionary["version"] = regexWorker["${version}"];
            dictionary["type"] = regexWorker["Firefox${major}"]; 
            dictionary["layoutEngine"] = "Gecko";
            dictionary["layoutEngineVersion"] = regexWorker["${layoutVersion}"]; 
            dictionary["ecmascriptversion"] = "3.0"; 
            dictionary["javascript"] = "true";
            dictionary["javascriptversion"] = "1.5"; 
            dictionary["w3cdomversion"] = "1.0";
            dictionary["supportsAccesskeyAttribute"] = "true";
            dictionary["tagwriter"] = "System.Web.UI.HtmlTextWriter";
            dictionary["cookies"] = "true"; 
            dictionary["frames"] = "true";
            dictionary["javaapplets"] = "true"; 
            dictionary["supportsCallback"] = "true"; 
            dictionary["supportsDivNoWrap"] = "false";
            dictionary["supportsFileUpload"] = "true"; 
            dictionary["supportsMultilineTextBoxDisplay"] = "true";
            dictionary["supportsXmlHttp"] = "true";
            dictionary["tables"] = "true";
            browserCaps.AddBrowser("Firefox"); 
            this.FirefoxProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = true; 
            // browser, parent=Firefox 
            if (this.Firefox3Process(headers, browserCaps)) {
            } 
            else {
                ignoreApplicationBrowsers = false;
            }
            this.FirefoxProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 
 
        protected virtual void Firefox3ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        protected virtual void Firefox3ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }
 
        private bool Firefox3Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities; 
            // Identification: check capability matches
            string headerValue; 
            headerValue = ((string)(dictionary["majorversion"]));
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "3");
            if ((result == false)) { 
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["javascriptversion"] = "1.8";
            dictionary["supportsMaintainScrollPositionOnPostback"] = "true";
            browserCaps.AddBrowser("Firefox3");
            this.Firefox3ProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = true;
            // browser, parent=Firefox3 
            if (this.Firefox35Process(headers, browserCaps)) { 
            }
            else { 
                ignoreApplicationBrowsers = false;
            }
            this.Firefox3ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        protected virtual void Firefox35ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        protected virtual void Firefox35ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        private bool Firefox35Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check capability matches 
            string headerValue;
            headerValue = ((string)(dictionary["minorversion"])); 
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "^[5-9]"); 
            if ((result == false)) {
                return false; 
            } 
            // Capabilities: set capabilities
            browserCaps.AddBrowser("Firefox35"); 
            this.Firefox35ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false;
            this.Firefox35ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        protected virtual void CrawlerProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        protected virtual void CrawlerProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        private bool CrawlerProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "crawler|Crawler|Googlebot|msnbot"); 
            if ((result == false)) {
                return false; 
            } 
            // Capabilities: set capabilities
            dictionary["crawler"] = "true"; 
            this.CrawlerProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false;
            this.CrawlerProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        protected virtual void PlatformProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        protected virtual void PlatformProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        private bool PlatformProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty])); 
            if (string.IsNullOrEmpty(headerValue)) {
                return false;
            }
            // Capabilities: set capabilities 
            this.PlatformProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = true; 
            // browser, parent=Platform 
            if (this.PlatformwinntProcess(headers, browserCaps)) {
            } 
            else {
                if (this.Platformwin2000bProcess(headers, browserCaps)) {
                }
                else { 
                    if (this.Platformwin95Process(headers, browserCaps)) {
                    } 
                    else { 
                        if (this.Platformwin98Process(headers, browserCaps)) {
                        } 
                        else {
                            if (this.Platformwin16Process(headers, browserCaps)) {
                            }
                            else { 
                                if (this.PlatformwinceProcess(headers, browserCaps)) {
                                } 
                                else { 
                                    if (this.Platformmac68kProcess(headers, browserCaps)) {
                                    } 
                                    else {
                                        if (this.PlatformmacppcProcess(headers, browserCaps)) {
                                        }
                                        else { 
                                            if (this.PlatformunixProcess(headers, browserCaps)) {
                                            } 
                                            else { 
                                                if (this.PlatformwebtvProcess(headers, browserCaps)) {
                                                } 
                                                else {
                                                    ignoreApplicationBrowsers = false;
                                                }
                                            } 
                                        }
                                    } 
                                } 
                            }
                        } 
                    }
                }
            }
            this.PlatformProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 
 
        protected virtual void PlatformwinntProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        protected virtual void PlatformwinntProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }
 
        private bool PlatformwinntProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "Windows NT|WinNT|Windows XP");
            if ((result == false)) { 
                return false; 
            }
            headerValue = ((string)(browserCaps[string.Empty])); 
            result = regexWorker.ProcessRegex(headerValue, "WinCE|Windows CE");
            if ((result == true)) {
                return false;
            } 
            // Capabilities: set capabilities
            dictionary["platform"] = "WinNT"; 
            this.PlatformwinntProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = true;
            // browser, parent=PlatformWinnt 
            if (this.PlatformwinxpProcess(headers, browserCaps)) {
            }
            else {
                if (this.Platformwin2000aProcess(headers, browserCaps)) { 
                }
                else { 
                    ignoreApplicationBrowsers = false; 
                }
            } 
            this.PlatformwinntProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void PlatformwinxpProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void PlatformwinxpProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool PlatformwinxpProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Windows (NT 5\\.1|XP)");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "WinXP"; 
            this.PlatformwinxpProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.PlatformwinxpProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void Platformwin2000aProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void Platformwin2000aProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Platformwin2000aProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Windows NT 5\\.0");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "Win2000"; 
            this.Platformwin2000aProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Platformwin2000aProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void Platformwin2000bProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void Platformwin2000bProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Platformwin2000bProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Windows 2000");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "Win2000"; 
            this.Platformwin2000bProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Platformwin2000bProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void Platformwin95ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void Platformwin95ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Platformwin95Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Win(dows )?95");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "Win95"; 
            this.Platformwin95ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Platformwin95ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void Platformwin98ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void Platformwin98ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Platformwin98Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Win(dows )?98");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "Win98"; 
            this.Platformwin98ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Platformwin98ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void Platformwin16ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void Platformwin16ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Platformwin16Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Win(dows 3\\.1|16)");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "Win16"; 
            this.Platformwin16ProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Platformwin16ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void PlatformwinceProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void PlatformwinceProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool PlatformwinceProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Win(dows )?CE");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "WinCE"; 
            this.PlatformwinceProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.PlatformwinceProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void Platformmac68kProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void Platformmac68kProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Platformmac68kProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Mac(_68(000|K)|intosh.*68K)");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "Mac68K"; 
            this.Platformmac68kProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.Platformmac68kProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void PlatformmacppcProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void PlatformmacppcProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool PlatformmacppcProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Mac(_PowerPC|intosh.*PPC|_PPC)|PPC Mac");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "MacPPC"; 
            this.PlatformmacppcProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.PlatformmacppcProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void PlatformunixProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void PlatformunixProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool PlatformunixProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "X11");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "UNIX"; 
            this.PlatformunixProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.PlatformunixProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void PlatformwebtvProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void PlatformwebtvProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool PlatformwebtvProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "WebTV");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["platform"] = "WebTV"; 
            this.PlatformwebtvProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.PlatformwebtvProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true;
        }
 
        protected virtual void WinProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        protected virtual void WinProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool WinProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            if (string.IsNullOrEmpty(headerValue)) {
                return false; 
            }
            // Capabilities: set capabilities
            this.WinProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = true; 
            // browser, parent=Win
            if (this.Win32Process(headers, browserCaps)) { 
            } 
            else {
                if (this.Win16Process(headers, browserCaps)) { 
                }
                else {
                    ignoreApplicationBrowsers = false;
                } 
            }
            this.WinProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void Win32ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void Win32ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool Win32Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "Win(dows )?(9[58]|NT|32)"); 
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities
            dictionary["win32"] = "true";
            this.Win32ProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false;
            this.Win32ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void Win16ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void Win16ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool Win16Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "16bit|Win(dows 3\\.1|16)"); 
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities
            dictionary["win16"] = "true";
            this.Win16ProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false;
            this.Win16ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void GenericdownlevelProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void GenericdownlevelProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool GenericdownlevelProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "^Generic Downlevel$"); 
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities
            dictionary["cookies"] = "false";
            dictionary["ecmascriptversion"] = "1.0"; 
            dictionary["tables"] = "true";
            dictionary["type"] = "Downlevel"; 
            browserCaps.Adapters["System.Web.UI.WebControls.Menu, System.Web, Version=4.0.0.0, Culture=neutral, Pub" + 
                "licKeyToken=b03f5f7f11d50a3a"] = "System.Web.UI.WebControls.Adapters.MenuAdapter";
            browserCaps.AddBrowser("GenericDownlevel"); 
            this.GenericdownlevelProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false;
            this.GenericdownlevelProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        protected virtual void MozillaProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        protected virtual void MozillaProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        private bool MozillaProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Mozilla"); 
            if ((result == false)) {
                return false; 
            } 
            // Capabilities: set capabilities
            dictionary["browser"] = "Mozilla"; 
            dictionary["cookies"] = "false";
            dictionary["inputType"] = "keyboard";
            dictionary["isColor"] = "true";
            dictionary["isMobileDevice"] = "false"; 
            dictionary["maximumRenderedPageSize"] = "300000";
            dictionary["screenBitDepth"] = "8"; 
            dictionary["supportsBold"] = "true"; 
            dictionary["supportsCss"] = "true";
            dictionary["supportsDivNoWrap"] = "true"; 
            dictionary["supportsFontName"] = "true";
            dictionary["supportsFontSize"] = "true";
            dictionary["supportsImageSubmit"] = "true";
            dictionary["supportsItalic"] = "true"; 
            dictionary["type"] = "Mozilla";
            browserCaps.AddBrowser("Mozilla"); 
            this.MozillaProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = true;
            // browser, parent=Mozilla 
            if (this.IeProcess(headers, browserCaps)) {
            }
            else {
                if (this.ChromeProcess(headers, browserCaps)) { 
                }
                else { 
                    if (this.FirefoxProcess(headers, browserCaps)) { 
                    }
                    else { 
                        if (this.IemobileProcess(headers, browserCaps)) {
                        }
                        else {
                            if (this.SafariProcess(headers, browserCaps)) { 
                            }
                            else { 
                                ignoreApplicationBrowsers = false; 
                            }
                        } 
                    }
                }
            }
            this.MozillaProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 
 
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process IEMobile gateways.")]
        protected virtual void IemobileProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }

        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process IEMobile browsers.")]
        protected virtual void IemobileProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool IemobileProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "IEMobile.(?\'version\'(?\'major\'\\d+)(\\.(?\'minor\'\\d+)?)\\w*)"); 
            if ((result == false)) {
                return false; 
            }
            // Capture: header values
            regexWorker.ProcessRegex(((string)(browserCaps[string.Empty])), "MSIE (?\'msieMajorVersion\'\\d+)");
            // Capabilities: set capabilities 
            dictionary["layoutEngine"] = "Trident";
            dictionary["browser"] = "IEMobile"; 
            dictionary["majorversion"] = regexWorker["${major}"]; 
            dictionary["minorversion"] = regexWorker["${minor}"];
            dictionary["type"] = regexWorker["IEMobile${msieMajorVersion}"]; 
            dictionary["isMobileDevice"] = "true";
            dictionary["version"] = regexWorker["${version}"];
            dictionary["ecmascriptversion"] = "3.0";
            dictionary["jscriptversion"] = "5.6"; 
            dictionary["javascript"] = "true";
            dictionary["javascriptversion"] = "1.5"; 
            dictionary["msdomversion"] = regexWorker["${majorversion}.${minorversion}"]; 
            dictionary["w3cdomversion"] = "1.0";
            dictionary["supportsAccesskeyAttribute"] = "true"; 
            dictionary["tagwriter"] = "System.Web.UI.HtmlTextWriter";
            dictionary["cookies"] = "true";
            dictionary["frames"] = "true";
            dictionary["javaapplets"] = "true"; 
            dictionary["supportsCallback"] = "true";
            dictionary["supportsDivNoWrap"] = "false"; 
            dictionary["supportsFileUpload"] = "true"; 
            dictionary["supportsMultilineTextBoxDisplay"] = "true";
            dictionary["supportsXmlHttp"] = "true"; 
            dictionary["tables"] = "true";
            dictionary["vbscript"] = "true";
            dictionary["inputType"] = "virtualKeyboard";
            dictionary["numberOfSoftkeys"] = "2"; 
            browserCaps.AddBrowser("IEMobile");
            this.IemobileProcessGateways(headers, browserCaps); 
            // gateway, parent=IEMobile 
            this.MonoProcess(headers, browserCaps);
            // gateway, parent=IEMobile 
            this.PixelsProcess(headers, browserCaps);
            // gateway, parent=IEMobile
            this.OsProcess(headers, browserCaps);
            // gateway, parent=IEMobile 
            this.CpuProcess(headers, browserCaps);
            // gateway, parent=IEMobile 
            this.VoiceProcess(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false;
            this.IemobileProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        }

        protected virtual void MonoProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        protected virtual void MonoProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool MonoProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(headers["UA-COLOR"])); 
            if (string.IsNullOrEmpty(headerValue)) { 
                return false;
            } 
            headerValue = ((string)(headers["UA-COLOR"]));
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "mono(?\'colorDepth\'\\d+)");
            if ((result == false)) { 
                return false; 
            }
            browserCaps.DisableOptimizedCacheKey(); 
            // Capabilities: set capabilities
            dictionary["isColor"] = "false";
            dictionary["screenBitDepth"] = regexWorker["${colorDepth}"];
            this.MonoProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false;
            this.MonoProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void PixelsProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void PixelsProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool PixelsProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(headers["UA-PIXELS"]));
            if (string.IsNullOrEmpty(headerValue)) { 
                return false;
            } 
            headerValue = ((string)(headers["UA-PIXELS"])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "(?\'screenWidth\'\\d+)x(?\'screenHeight\'\\d+)");
            if ((result == false)) {
                return false; 
            }
            browserCaps.DisableOptimizedCacheKey(); 
            // Capabilities: set capabilities 
            dictionary["screenPixelsHeight"] = regexWorker["${screenHeight}"];
            dictionary["screenPixelsWidth"] = regexWorker["${screenWidth}"]; 
            this.PixelsProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false;
            this.PixelsProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        [SuppressMessage("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase", MessageId = "This is auto-generated method.")] 
        protected virtual void OSProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        [SuppressMessage("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase", MessageId = "This is auto-generated method.")]
        protected virtual void OSProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool OsProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(headers["UA-OS"]));
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "(?\'os\'.+)"); 
            if ((result == false)) { 
                return false;
            } 
            browserCaps.DisableOptimizedCacheKey();
            // Capabilities: set capabilities
            dictionary["platform"] = regexWorker["${os}"];
            this.OSProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false;
            this.OSProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void CpuProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void CpuProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool CpuProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(headers["UA-CPU"]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "(?\'cpu\'.+)"); 
            if ((result == false)) {
                return false; 
            }
            browserCaps.DisableOptimizedCacheKey();
            // Capabilities: set capabilities
            dictionary["cpu"] = regexWorker["${cpu}"]; 
            this.CpuProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false; 
            this.CpuProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 

        protected virtual void VoiceProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }
 
        protected virtual void VoiceProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 
 
        private bool VoiceProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(headers["UA-VOICE"])); 
            if (string.IsNullOrEmpty(headerValue)) {
                return false; 
            } 
            headerValue = ((string)(headers["UA-VOICE"]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "(?i:TRUE)");
            if ((result == false)) { 
                return false;
            } 
            browserCaps.DisableOptimizedCacheKey(); 
            // Capabilities: set capabilities
            dictionary["canInitiateVoiceCall"] = "true"; 
            this.VoiceProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false;
            this.VoiceProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process IPhone gateways.")] 
        protected virtual void IphoneProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process IPhone browsers.")]
        protected virtual void IphoneProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool IphoneProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "iPhone"); 
            if ((result == false)) { 
                return false;
            } 
            // Capabilities: set capabilities
            dictionary["mobileDeviceModel"] = "IPhone";
            dictionary["mobileDeviceManufacturer"] = "Apple";
            dictionary["isMobileDevice"] = "true"; 
            dictionary["canInitiateVoiceCall"] = "true";
            this.IphoneProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false; 
            this.IphoneProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }

        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process IPod gateways.")]
        protected virtual void IpodProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Process IPod browsers.")] 
        protected virtual void IpodProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool IpodProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "iPod");
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities 
            dictionary["mobileDeviceModel"] = "IPod"; 
            dictionary["mobileDeviceManufacturer"] = "Apple";
            dictionary["isMobileDevice"] = "true"; 
            this.IpodProcessGateways(headers, browserCaps);
            bool ignoreApplicationBrowsers = false;
            this.IpodProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        }
 
        protected virtual void SafariProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        protected virtual void SafariProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        private bool SafariProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches 
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty])); 
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "Safari"); 
            if ((result == false)) {
                return false; 
            } 
            headerValue = ((string)(browserCaps[string.Empty]));
            result = regexWorker.ProcessRegex(headerValue, "Chrome"); 
            if ((result == true)) {
                return false;
            }
            // Capture: header values 
            regexWorker.ProcessRegex(((string)(browserCaps[string.Empty])), "AppleWebKit/(?\'layoutVersion\'\\d+)");
            // Capabilities: set capabilities 
            dictionary["layoutEngine"] = "WebKit"; 
            dictionary["layoutEngineVersion"] = regexWorker["${layoutVersion}"];
            dictionary["browser"] = "Safari"; 
            dictionary["type"] = "Safari";
            browserCaps.AddBrowser("Safari");
            this.SafariProcessGateways(headers, browserCaps);
            // gateway, parent=Safari 
            this.IphoneProcess(headers, browserCaps);
            // gateway, parent=Safari 
            this.IpodProcess(headers, browserCaps); 
            bool ignoreApplicationBrowsers = true;
            // browser, parent=Safari 
            if (this.Safari3to4Process(headers, browserCaps)) {
            }
            else {
                ignoreApplicationBrowsers = false; 
            }
            this.SafariProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void Safari3to4ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        protected virtual void Safari3to4ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }
 
        private bool Safari3to4Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue;
            headerValue = ((string)(browserCaps[string.Empty]));
            bool result; 
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "Version/(?\'version\'(?\'major\'\\d+)(\\.(?\'minor\'\\d+)?)\\w*)"); 
            if ((result == false)) {
                return false; 
            }
            // Capabilities: set capabilities
            dictionary["version"] = regexWorker["${version}"];
            dictionary["majorversion"] = regexWorker["${major}"]; 
            dictionary["minorversion"] = regexWorker["${minor}"];
            dictionary["type"] = regexWorker["Safari${major}"]; 
            dictionary["ecmascriptversion"] = "3.0"; 
            dictionary["javascript"] = "true";
            dictionary["javascriptversion"] = "1.6"; 
            dictionary["w3cdomversion"] = "1.0";
            dictionary["tagwriter"] = "System.Web.UI.HtmlTextWriter";
            dictionary["cookies"] = "true";
            dictionary["frames"] = "true"; 
            dictionary["javaapplets"] = "true";
            dictionary["supportsAccesskeyAttribute"] = "true"; 
            dictionary["supportsCallback"] = "true"; 
            dictionary["supportsDivNoWrap"] = "false";
            dictionary["supportsFileUpload"] = "true"; 
            dictionary["supportsMaintainScrollPositionOnPostback"] = "true";
            dictionary["supportsMultilineTextBoxDisplay"] = "true";
            dictionary["supportsXmlHttp"] = "true";
            dictionary["tables"] = "true"; 
            browserCaps.AddBrowser("Safari3to4");
            this.Safari3to4ProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = true; 
            // browser, parent=Safari3to4
            if (this.Safari4Process(headers, browserCaps)) { 
            }
            else {
                ignoreApplicationBrowsers = false;
            } 
            this.Safari3to4ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps);
            return true; 
        } 

        protected virtual void Safari4ProcessGateways(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
        }

        protected virtual void Safari4ProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool Safari4Process(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities;
            // Identification: check capability matches 
            string headerValue;
            headerValue = ((string)(dictionary["majorversion"]));
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "4"); 
            if ((result == false)) { 
                return false;
            } 
            // Capabilities: set capabilities
            dictionary["javascriptversion"] = "1.7";
            browserCaps.AddBrowser("Safari4");
            this.Safari4ProcessGateways(headers, browserCaps); 
            bool ignoreApplicationBrowsers = false;
            this.Safari4ProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true; 
        }
 
        protected virtual void DefaultDefaultProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }

        private bool DefaultDefaultProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) { 
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Capabilities: set capabilities 
            dictionary["ecmascriptversion"] = "0.0";
            dictionary["javascript"] = "false"; 
            dictionary["jscriptversion"] = "0.0";
            bool ignoreApplicationBrowsers = true;
            // browser, parent=Default
            if (this.DefaultWmlProcess(headers, browserCaps)) { 
            }
            else { 
                if (this.DefaultXhtmlmpProcess(headers, browserCaps)) { 
                }
                else { 
                    ignoreApplicationBrowsers = false;
                }
            }
            this.DefaultDefaultProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 
 
        protected virtual void DefaultWmlProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        } 

        private bool DefaultWmlProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary;
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(headers["Accept"])); 
            bool result;
            RegexWorker regexWorker; 
            regexWorker = new RegexWorker(browserCaps);
            result = regexWorker.ProcessRegex(headerValue, "text/vnd\\.wap\\.wml|text/hdml");
            if ((result == false)) {
                return false; 
            }
            headerValue = ((string)(headers["Accept"])); 
            result = regexWorker.ProcessRegex(headerValue, "application/xhtml\\+xml; profile|application/vnd\\.wap\\.xhtml\\+xml"); 
            if ((result == true)) {
                return false; 
            }
            browserCaps.DisableOptimizedCacheKey();
            // Capabilities: set capabilities
            dictionary["preferredRenderingMime"] = "text/vnd.wap.wml"; 
            dictionary["preferredRenderingType"] = "wml11";
            bool ignoreApplicationBrowsers = false; 
            this.DefaultWmlProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 

        protected virtual void DefaultXhtmlmpProcessBrowsers(bool ignoreApplicationBrowsers, System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
        }
 
        private bool DefaultXhtmlmpProcess(System.Collections.Specialized.NameValueCollection headers, System.Web.HttpBrowserCapabilities browserCaps) {
            System.Collections.IDictionary dictionary; 
            dictionary = browserCaps.Capabilities; 
            // Identification: check header matches
            string headerValue; 
            headerValue = ((string)(headers["Accept"]));
            bool result;
            RegexWorker regexWorker;
            regexWorker = new RegexWorker(browserCaps); 
            result = regexWorker.ProcessRegex(headerValue, "application/xhtml\\+xml; profile|application/vnd\\.wap\\.xhtml\\+xml");
            if ((result == false)) { 
                return false; 
            }
            headerValue = ((string)(headers["Accept"])); 
            result = regexWorker.ProcessRegex(headerValue, "text/hdml");
            if ((result == true)) {
                return false;
            } 
            headerValue = ((string)(headers["Accept"]));
            result = regexWorker.ProcessRegex(headerValue, "text/vnd\\.wap\\.wml"); 
            if ((result == true)) { 
                return false;
            } 
            browserCaps.DisableOptimizedCacheKey();
            // Capabilities: set capabilities
            dictionary["preferredRenderingMime"] = "text/html";
            dictionary["preferredRenderingType"] = "xhtml-mp"; 
            browserCaps.HtmlTextWriter = "System.Web.UI.XhtmlTextWriter";
            bool ignoreApplicationBrowsers = false; 
            this.DefaultXhtmlmpProcessBrowsers(ignoreApplicationBrowsers, headers, browserCaps); 
            return true;
        } 

        protected override void PopulateMatchedHeaders(System.Collections.IDictionary dictionary) {
            base.PopulateMatchedHeaders(dictionary);
            dictionary[""] = null; 
            dictionary["UA-COLOR"] = null;
            dictionary["UA-PIXELS"] = null; 
            dictionary["UA-OS"] = null; 
            dictionary["UA-CPU"] = null;
            dictionary["UA-VOICE"] = null; 
            dictionary["Accept"] = null;
        }

        protected override void PopulateBrowserElements(System.Collections.IDictionary dictionary) { 
            base.PopulateBrowserElements(dictionary);
            dictionary["Default"] = new System.Web.UI.Triplet(null, string.Empty, 0); 
            dictionary["BlackBerry"] = new System.Web.UI.Triplet("Default", string.Empty, 1); 
            dictionary["Opera"] = new System.Web.UI.Triplet("Default", string.Empty, 1);
            dictionary["Opera8to9"] = new System.Web.UI.Triplet("Opera", string.Empty, 2); 
            dictionary["Opera10"] = new System.Web.UI.Triplet("Opera", string.Empty, 2);
            dictionary["GenericDownlevel"] = new System.Web.UI.Triplet("Default", string.Empty, 1);
            dictionary["Mozilla"] = new System.Web.UI.Triplet("Default", string.Empty, 1);
            dictionary["IE"] = new System.Web.UI.Triplet("Mozilla", string.Empty, 2); 
            dictionary["IE6to9"] = new System.Web.UI.Triplet("Ie", string.Empty, 3);
            dictionary["IE7"] = new System.Web.UI.Triplet("Ie6to9", string.Empty, 4); 
            dictionary["IE8"] = new System.Web.UI.Triplet("Ie6to9", string.Empty, 4); 
            dictionary["Chrome"] = new System.Web.UI.Triplet("Mozilla", string.Empty, 2);
            dictionary["Firefox"] = new System.Web.UI.Triplet("Mozilla", string.Empty, 2); 
            dictionary["Firefox3"] = new System.Web.UI.Triplet("Firefox", string.Empty, 3);
            dictionary["Firefox35"] = new System.Web.UI.Triplet("Firefox3", string.Empty, 4);
            dictionary["IEMobile"] = new System.Web.UI.Triplet("Mozilla", string.Empty, 2);
            dictionary["Safari"] = new System.Web.UI.Triplet("Mozilla", string.Empty, 2); 
            dictionary["Safari3to4"] = new System.Web.UI.Triplet("Safari", string.Empty, 3);
            dictionary["Safari4"] = new System.Web.UI.Triplet("Safari3to4", string.Empty, 4); 
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK