SetVendor() public method

public SetVendor ( String vendor ) : void
vendor String
return void
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            String version = null;

            if (!versionRegex.IsMatch(userAgent.completeUserAgent))
            {
                return null;

            }
            else
            {
                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = versionMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    version = groups[1].Value;
                }
            }

            int confidence = 60;
            Browser identified = new Browser();

            identified.SetVendor("HP");
            identified.SetModel("Web OS Browser");
            identified.SetVersion(version);
            String[] versionEl = version.Split(".".ToCharArray());

            if (versionEl.Length > 0)
            {
                identified.majorRevision = versionEl[0];
            }

            if (versionEl.Length > 1)
            {
                identified.microRevision = versionEl[1];
                confidence += 10;
            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            if (!userAgent.containsWindowsPhone || !(windowsCePhoneRegex.IsMatch(userAgent.completeUserAgent)))
            {
                return null;
            }

            int confidence = 40;
            Browser identified = new Browser();

            identified.SetVendor("Microsoft");
            identified.SetModel("IEMobile");

            if (userAgent.completeUserAgent.Contains("MSIEMobile"))
            {
                confidence += 10;
            }

            if (userAgent.mozillaPattern)
            {
                confidence += 10;
            }

            if (versionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = versionMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetVersion(groups[1].Value);

                    string versionFullString = groups[1].Value;
                    String[] version = versionFullString.Split(".".ToCharArray());

                    if (version.Length > 0)
                    {
                        identified.majorRevision = version[0];
                        if (identified.majorRevision.Length == 0)
                        {
                            identified.majorRevision = "1";
                        }
                    }

                    if (version.Length > 1)
                    {
                        identified.minorRevision = version[1];
                        confidence += 10;
                    }

                    if (version.Length > 2)
                    {
                        identified.microRevision = version[2];
                    }

                    if (version.Length > 3)
                    {
                        identified.nanoRevision = version[3];
                    }
                }

            }
            else
            {
                //fallback version
                identified.SetVersion("1.0");
                identified.majorRevision = "1";
            }

            if (msieVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match msieMatcher = msieVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = msieMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetReferenceBrowser("MSIE");
                    identified.SetReferenceBrowserVersion(groups[1].Value);
                    confidence += 10;
                }
            }

            if (msieMobileVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match msieMobileMatcher = msieMobileVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = msieMobileMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetLayoutEngine("MSIEMobile");
                    identified.SetLayoutEngineVersion(groups[1].Value);
                    confidence += 10;
                }
            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.TRIDENT))
                {
                    confidence += 10;
                }
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            if (!(userAgent.mozillaPattern))
            {
                return null;
            }

            int confidence = 60;
            Browser identified = new Browser();

            identified.SetVendor("Mozilla");
            identified.SetModel("Firefox Mobile");
            identified.SetVersion("-");
            identified.majorRevision = "-";

            if (fennecVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match fennecMatcher = fennecVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = fennecMatcher.Groups;
                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetVersion(groups[1].Value);

                    string versionFullString = groups[1].Value;
                    String[] version = versionFullString.Split(".".ToCharArray());

                    if (version.Length > 0)
                    {
                        identified.majorRevision = version[0];
                        if (identified.majorRevision.Length == 0)
                        {
                            identified.majorRevision = "1";
                        }
                    }

                    if (version.Length > 1)
                    {
                        identified.minorRevision = version[1];
                        confidence += 10;
                    }

                    if (version.Length > 2)
                    {
                        identified.microRevision = version[2];
                    }

                    if (version.Length > 3)
                    {
                        identified.nanoRevision = version[3];
                    }
                }

            }
            else if (firefoxVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match firefoxMatcher = firefoxVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = firefoxMatcher.Groups;
                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetVersion(groups[1].Value);

                    string versionFullString = groups[1].Value;
                    String[] version = versionFullString.Split(".".ToCharArray());

                    if (version.Length > 0)
                    {
                        identified.majorRevision = version[0];
                        if (identified.majorRevision.Length == 0)
                        {
                            identified.majorRevision = "1";
                        }
                    }

                    if (version.Length > 1)
                    {
                        identified.minorRevision = version[1];
                        confidence += 10;
                    }

                    if (version.Length > 2)
                    {
                        identified.microRevision = version[2];
                    }

                    if (version.Length > 3)
                    {
                        identified.nanoRevision = version[3];
                    }
                }
            }
            else
            {
                //fallback version
                identified.SetVersion("1.0");
                identified.majorRevision = "1";
            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.GECKO))
                {
                    confidence += 10;
                }
            }

            if (firefoxVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match firefoxMatcher = firefoxVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = firefoxMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetReferenceBrowser("Firefox");
                    identified.SetReferenceBrowserVersion(groups[1].Value);
                    confidence += 10;
                }
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            if (!(userAgent.mozillaPattern || userAgent.completeUserAgent.Contains("SymbianOS") || userAgent.completeUserAgent.Contains("Symbian/3") || userAgent.completeUserAgent.Contains("Nokia"))) {
                return null;
            }

            int confidence = 50;
            Browser identified = new Browser();

            identified.SetVendor("Nokia");
            identified.SetModel("Nokia Browser");
            identified.SetVersion("-");
            identified.majorRevision = "-";

            if (nokiaBrowserVersionRegex.IsMatch(userAgent.completeUserAgent)) {
                Match nokiaBrowserMatcher = nokiaBrowserVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = nokiaBrowserMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0) {
                    identified.SetVersion(groups[1].Value);

                    string versionFullString = groups[1].Value;
                    String[] version = versionFullString.Split(".".ToCharArray());

                    if (version.Length > 0) {
                        identified.majorRevision = version[0];
                        if (identified.majorRevision.Length == 0) {
                            identified.majorRevision = "1";
                        }
                    }

                    if (version.Length > 1) {
                        identified.minorRevision = version[1];
                        confidence += 10;
                    }

                    if (version.Length > 2) {
                        identified.microRevision = version[2];
                    }

                    if (version.Length > 3) {
                        identified.nanoRevision = version[3];
                    }
                }

            }

            if (layoutEngine != null) {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.APPLEWEBKIT)) {
                    confidence += 10;
                }
            }

            if (safariVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match safariMatcher = safariVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = safariMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetReferenceBrowser("Safari");
                    identified.SetReferenceBrowserVersion(groups[1].Value);
                    confidence += 10;
                }
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            if ((!userAgent.operaPattern || userAgent.operaVersion == null || userAgent.operaVersion.Length == 0) && (!operaVersionRegex.IsMatch(userAgent.completeUserAgent)))
            {
                return null;
            }

            int confidence = 60;
            Browser identified = new Browser();

            identified.SetVendor("Opera");
            if (userAgent.completeUserAgent.Contains("Mobi"))
            {
                identified.SetModel("Opera Mobile");
                confidence += 10;

            }
            else if (userAgent.completeUserAgent.Contains("Tablet"))
            {
                identified.SetModel("Opera Tablet");

            }
            else
            {
                identified.SetModel("Opera");
            }

            if (userAgent.operaVersion != null)
            {
                identified.SetVersion(userAgent.operaVersion);
            }
            else
            {
                if (operaVersionRegex.IsMatch(userAgent.completeUserAgent))
                {
                    Match operaMatcher = operaVersionRegex.Match(userAgent.completeUserAgent);
                    GroupCollection groups = operaMatcher.Groups;

                    if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                    {
                        identified.SetVersion(groups[1].Value);
                    }
                }
            }

            String[] version = identified.GetVersion().Split(".".ToCharArray());

            if (version.Length > 0)
            {
                identified.majorRevision = version[0];
            }

            if (version.Length > 1)
            {
                identified.minorRevision = version[1];
                confidence += 10;
            }

            if (version.Length > 2)
            {
                identified.microRevision = version[2];
            }

            if (version.Length > 3)
            {
                identified.nanoRevision = version[3];
            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.PRESTO))
                {
                    confidence += 10;
                }
            }

            if (userAgent.GetPatternElementsInside() != null)
            {
                String[] inside = userAgent.GetPatternElementsInside().Split(";".ToCharArray());
                foreach (String token in inside)
                {
                    String element = token.Trim();

                    if (operaMiniVersionRegex.IsMatch(element))
                    {
                        Match miniMatcher = operaMiniVersionRegex.Match(element);
                        GroupCollection groups = miniMatcher.Groups;

                        if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                        {
                            identified.SetReferenceBrowser("Opera Mobi");
                            identified.SetReferenceBrowserVersion(groups[1].Value);
                            confidence += 10;
                            break;
                        }
                    }
                }
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            String version = null;

            int confidence = 60;
            Browser identified = new Browser();
            identified.SetVendor("Obigo");
            identified.SetModel("Obigo Browser");

            if (!versionRegex.IsMatch(userAgent.completeUserAgent))
            {
                version = null;

            }
            else
            {
                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = versionMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    version = groups[1].Value;
                }
            }

            if (version == null)
            {
                if (!versionRegex2.IsMatch(userAgent.completeUserAgent))
                {
                    version = null;

                }
                else
                {
                    Match versionMatcher2 = versionRegex2.Match(userAgent.completeUserAgent);
                    GroupCollection groups = versionMatcher2.Groups;

                    if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                    {
                        version = groups[1].Value;
                    }
                }
            }

            if (version == null)
            {
                if (!versionRegex3.IsMatch(userAgent.completeUserAgent))
                {
                    version = null;

                }
                else
                {
                    Match versionMatcher3 = versionRegex3.Match(userAgent.completeUserAgent);
                    GroupCollection groups = versionMatcher3.Groups;

                    if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                    {
                        version = groups[1].Value;
                    }
                }
            }

            if (version == null)
            {
                if (!versionRegex4.IsMatch(userAgent.completeUserAgent))
                {
                    version = null;

                }
                else
                {
                    Match versionMatcher4 = versionRegex4.Match(userAgent.completeUserAgent);
                    GroupCollection groups = versionMatcher4.Groups;

                    if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                    {
                        version = groups[1].Value;
                    }
                }
            }

            if (version == null)
            {
                if (!versionRegex5.IsMatch(userAgent.completeUserAgent))
                {
                    version = null;

                }
                else
                {
                    Match versionMatcher5 = versionRegex5.Match(userAgent.completeUserAgent);
                    GroupCollection groups = versionMatcher5.Groups;

                    if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                    {
                        version = groups[1].Value;
                        identified.SetModel("Teleca-Obigo");
                    }
                }
            }

            if (version == null)
            {
                return null;
            }

            identified.SetVersion(version);

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            int confidence = 50;
            Browser identified = new Browser();

            identified.SetVendor("RIM");
            identified.SetModel("BlackBerry");
            identified.SetVersion("-");
            identified.majorRevision = "-";

            if (blackberryVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match blackberryBrowserMatcher = blackberryVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = blackberryBrowserMatcher.Groups;
                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    String totalVersion = groups[1].Value;

                    if (totalVersion.Length > 0)
                    {
                        identified.SetVersion(totalVersion);
                        String[] version = totalVersion.Split(".".ToCharArray());

                        if (version.Length > 0)
                        {
                            identified.majorRevision = version[0];
                            if (identified.majorRevision.Length == 0)
                            {
                                identified.majorRevision = "1";
                            }
                        }

                        if (version.Length > 1)
                        {
                            identified.minorRevision = version[1];
                            confidence += 10;
                        }

                        if (version.Length > 2)
                        {
                            identified.microRevision = version[2];
                        }

                        if (version.Length > 3)
                        {
                            identified.nanoRevision = version[3];
                        }
                    }
                }

            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.APPLEWEBKIT))
                {
                    confidence += 10;
                }
            }

            if (safariVersionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match safariMatcher = safariVersionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = safariMatcher.Groups;

                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetReferenceBrowser("Safari");
                    identified.SetReferenceBrowserVersion(groups[1].Value);
                    confidence += 10;
                }
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            if (!userAgent.mozillaPattern || !userAgent.completeUserAgent.Contains("Mobile"))
            {
                return null;
            }

            int confidence = 70;
            Browser identified = new Browser();

            identified.SetVendor("Google");
            identified.SetModel("Chrome");

            if (versionRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = versionMatcher.Groups;
                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetVersion(groups[1].Value);
                    string versionFullString = groups[1].Value;
                    String[] version = versionFullString.Split(".".ToCharArray());

                    if (version.Length > 0)
                    {
                        identified.majorRevision = version[0];
                    }

                    if (version.Length > 1)
                    {
                        identified.minorRevision = version[1];
                        confidence += 10;
                    }

                    if (version.Length > 2)
                    {
                        identified.microRevision = version[2];
                    }

                    if (version.Length > 3)
                    {
                        identified.nanoRevision = version[3];
                    }
                }
                else if (groups[2] != null && groups[2].Value.Trim().Length > 0)
                {
                    identified.SetVersion(groups[2].Value);
                    string versionFullString = groups[2].Value;
                    String[] version = versionFullString.Split(".".ToCharArray());

                    if (version.Length > 0)
                    {
                        identified.majorRevision = version[0];
                    }

                    if (version.Length > 1)
                    {
                        identified.minorRevision = version[1];
                        confidence += 10;
                    }

                    if (version.Length > 2)
                    {
                        identified.microRevision = version[2];
                    }

                    if (version.Length > 3)
                    {
                        identified.nanoRevision = version[3];
                    }
                }
            }
            else
            {
                //fallback version
                identified.SetVersion("18.0");
                identified.majorRevision = "18";
            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);

                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.APPLEWEBKIT))
                {
                    confidence += 10;
                }
            }

            if (safariRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match safariMatch = safariRegex.Match(userAgent.completeUserAgent);
                GroupCollection groups = safariMatch.Groups;
                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetReferenceBrowser("Safari");
                    identified.SetReferenceBrowserVersion(groups[1].Value);
                    confidence += 10;
                }
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            if (!versionRegex.IsMatch(userAgent.completeUserAgent))
            {
                return null;
            }

            Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
            GroupCollection groups = versionMatcher.Groups;

            int confidence = 60;
            Browser identified = new Browser();

            identified.SetVendor("Opera");
            identified.SetModel("Opera Mini");

            if (groups[1] != null && groups[1].Value.Trim().Length > 0)
            {
                identified.SetVersion(groups[1].Value);
            }
            if (groups[2] != null && groups[2].Value.Trim().Length > 0)
            {
                identified.majorRevision = groups[2].Value;
            }
            if (groups[3] != null && groups[3].Value.Trim().Length > 0)
            {
                identified.minorRevision = groups[3].Value;
            }
            if (groups[4] != null && groups[4].Value.Trim().Length > 0)
            {
                identified.microRevision = groups[4].Value;
            }
            if (groups[5] != null && groups[5].Value.Trim().Length > 0)
            {
                identified.nanoRevision = groups[5].Value;
            }

            if (userAgent.operaPattern && userAgent.operaVersion != null)
            {
                identified.SetReferenceBrowser("Opera");
                identified.SetReferenceBrowserVersion(userAgent.operaVersion);
                confidence += 20;
            }

            if (buildRegex.IsMatch(userAgent.completeUserAgent))
            {
                Match buildMatcher = buildRegex.Match(userAgent.completeUserAgent);
                GroupCollection buildGroups = buildMatcher.Groups;

                if (buildGroups[1] != null && buildGroups[1].Value.Trim().Length > 0)
                {
                    identified.SetBuild(buildGroups[1].Value);
                    confidence += 10;
                }
            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.PRESTO))
                {
                    confidence += 10;
                }
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
        protected override Browser BuildBrowser(UserAgent userAgent, String layoutEngine, String layoutEngineVersion, int hintedWidth, int hintedHeight)
        {
            if (!(userAgent.mozillaPattern))
            {
                return null;
            }

            int confidence = 60;
            Browser identified = new Browser();

            identified.SetVendor("Amazon");
            identified.SetModel("Silk");
            identified.SetVersion("-");
            identified.majorRevision = "-";

            Match silkMatcher = silkVersionRegex.Match(userAgent.GetPatternElementsInside());
            GroupCollection groups = silkMatcher.Groups;

            if (silkMatcher.Success)
            {
                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
                {
                    identified.SetVersion(groups[1].Value);
                    string versionFullString = groups[1].Value;
                    String[] version = versionFullString.Split(".".ToCharArray());

                    if (version.Length > 0)
                    {
                        identified.majorRevision = version[0];
                        if (identified.majorRevision.Length == 0)
                        {
                            identified.majorRevision = "1";
                        }
                    }

                    if (version.Length > 1)
                    {
                        identified.minorRevision = version[1];
                        confidence += 10;
                    }

                    if (version[2] != null)
                    {
                        String[] subVersion = version[2].Split("-".ToCharArray());

                        if (subVersion.Length > 0)
                        {
                            identified.microRevision = subVersion[0];
                        }

                        if (subVersion.Length > 1)
                        {
                            identified.nanoRevision = subVersion[1];
                        }
                    }
                }

            }
            else
            {
                //fallback version
                identified.SetVersion("1.0");
                identified.majorRevision = "1";
            }

            if (layoutEngine != null)
            {
                identified.SetLayoutEngine(layoutEngine);
                identified.SetLayoutEngineVersion(layoutEngineVersion);
                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.APPLEWEBKIT))
                {
                    confidence += 10;
                }
            }

            if (userAgent.containsAndroid)
            {
                identified.SetReferenceBrowser("Android Browser");
                Match androidMatcher = versionRegex.Match(userAgent.completeUserAgent);
                GroupCollection androidGroups = androidMatcher.Groups;

                if (androidMatcher.Success)
                {
                    if (androidGroups[1] != null && androidGroups[1].Value.Trim().Length > 0)
                    {
                        identified.SetReferenceBrowserVersion(androidGroups[1].Value);
                        confidence += 5;
                    }
                }
                confidence += 5;
            }
            else if (userAgent.completeUserAgent.Contains("Safari") && !userAgent.completeUserAgent.Contains("Mobile"))
            {
                identified.SetReferenceBrowser("Safari");
                Match safariMatcher = versionRegex.Match(userAgent.completeUserAgent);
                GroupCollection safariGroups = safariMatcher.Groups;

                if (safariMatcher.Success)
                {
                    if (safariGroups[1] != null && safariGroups[1].Value.Trim().Length > 0)
                    {
                        identified.SetReferenceBrowserVersion(safariGroups[1].Value);
                        confidence += 5;
                    }
                }
                confidence += 5;
            }

            identified.SetDisplayWidth(hintedWidth);
            identified.SetDisplayHeight(hintedHeight);
            identified.confidence = confidence;

            return identified;
        }
		protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
		{
			if (!userAgent.containsMSIE || !userAgent.mozillaPattern || windowsCePhoneRegex.IsMatch(userAgent.completeUserAgent))
			{
				return null;
			}

			int confidence = 60;
			Browser identified = new Browser();

			identified.SetVendor("Microsoft");
			identified.SetModel("Internet Explorer");

			if (msieVersion10AndLowerRegex.IsMatch(userAgent.completeUserAgent))
			{
				Match msieMatcher = msieVersion10AndLowerRegex.Match(userAgent.completeUserAgent);
				GroupCollection groups = msieMatcher.Groups;

				if (groups[1] != null && groups[1].Value.Trim().Length > 0)
				{
					identified.SetVersion(groups[1].Value);

					string versionFullString = groups[1].Value;
					String[] version = versionFullString.Split(".".ToCharArray());

					if (version.Length > 0)
					{
						identified.majorRevision = version[0];
						if (identified.majorRevision.Length == 0)
						{
							identified.majorRevision = "1";
						}
					}

					if (version.Length > 1)
					{
						identified.minorRevision = version[1];
						confidence += 10;
					}
				}

			}
			else if (msieVersion11AndHigherRegex.IsMatch(userAgent.completeUserAgent))
			{
				Match msieMatcher = msieVersion11AndHigherRegex.Match(userAgent.completeUserAgent);
				GroupCollection groups = msieMatcher.Groups;

				if (groups[1] != null && groups[1].Value.Trim().Length > 0)
				{
					identified.SetVersion(groups[1].Value);

					string versionFullString = groups[1].Value;
					String[] version = versionFullString.Split(".".ToCharArray());

					if (version.Length > 0)
					{
						identified.majorRevision = version[0];
						if (identified.majorRevision.Length == 0)
						{
							identified.majorRevision = "1";
						}
					}

					if (version.Length > 1)
					{
						identified.minorRevision = version[1];
						confidence += 10;
					}
				}
			}
			else
			{
				//fallback version
				identified.SetVersion("1.0");
				identified.majorRevision = "1";
			}

			if (layoutEngine != null)
			{
				identified.SetLayoutEngine(layoutEngine);
				identified.SetLayoutEngineVersion(layoutEngineVersion);
				if (layoutEngine.Equals(LayoutEngineBrowserBuilder.TRIDENT))
				{
					confidence += 10;
				}
			}

			if (dotNetClrRegex.IsMatch(userAgent.completeUserAgent))
			{
				confidence += 10;
			}

			identified.SetDisplayWidth(hintedWidth);
			identified.SetDisplayHeight(hintedHeight);
			identified.confidence = confidence;

			return identified;
		}