private static void NameVersionAction(Match match, Object obj) { ClientOs current = obj as ClientOs; current.Name = new Regex(@"^[a-zA-Z]+", RegexOptions.IgnoreCase).Match(match.Value).Value; if (match.Value.Length > current.Name.Length) { current.Version = match.Value.Substring(current.Name.Length + 1); } }
/// <summary> /// Constructor /// </summary> /// <param name="userAgent">User agent string</param> public ClientCapabilities(string userAgent) { //Arguments validation if (string.IsNullOrEmpty(userAgent)) { throw new ArgumentNullException(nameof(userAgent)); } //Set values UserAgent = userAgent; //Build client browser and os ClientBrowser = new ClientBrowser(userAgent); ClientOs = new ClientOs(userAgent); }