protected Protocol(string url, string trackingId) { this.baseUrl = new Uri(url); this.trackingId = Parameter.Text(ParameterName.TrackingId, new TrackingIdValue(trackingId)); this.trackingParameters = new Parameter[] { this.version, this.trackingId, Parameter.Boolean(ParameterName.HitNonInteractive, ParameterBooleanValue.True), Parameter.Text(ParameterName.UserAgentOverride, new ParameterTextValue(ParameterName.UserAgentOverride, ASCIIEncoding.Unicode.GetByteCount(userAgent))) }; this.parameterSets = new List<Dictionary<string, Parameter>>( new Dictionary<string, Parameter>[] { this.trackingParameters.ToDictionary(p => p.Name, p => p) }); }
public Protocol WithParameter(Parameter parameter) { this.parameterSets.Last()[parameter.Name] = parameter; return this; }