/// <summary> /// Gets arguments that carry environment information. /// </summary> /// <param name="environmentInfo">Environment information.</param> public static IEnumerable <string> GetEnvironmentInfoArgs(PiwikEnvironmentInfo environmentInfo) { if (null == environmentInfo) { return(Enumerable.Empty <string>()); } var args = new List <string>(); if (null != environmentInfo.DeviceScreen) { args.Add(string.Format(CultureInfo.InvariantCulture, "res={0}x{1}", environmentInfo.DeviceScreen.Width, environmentInfo.DeviceScreen.Height)); } return(args); }
/// <summary> /// Initializes a new instance of the <see cref="ApplyUserAgentHttpMessageHandler"/> class. /// </summary> /// <param name="innerHandler">Inner handler.</param> /// <param name="environmentInfo">Environment info to get user agent string from.</param> public ApplyUserAgentHttpMessageHandler(HttpMessageHandler innerHandler, PiwikEnvironmentInfo environmentInfo) : base(innerHandler) { this.environmentInfo = environmentInfo; }