public TrackingApplicationAttribute() { var a = Assembly.GetEntryAssembly(); if (a != null) { Name = AssemblyInformation.GetAssemblyTitle(a); Version = AssemblyInformation.GetAssemblyVersion(a).ToString(3); } }
/// <summary> /// Instantiates a <see cref="TrackingEngine"/> instance /// </summary> /// <exception cref="InvalidOperationException"> /// Thrown if the user attempts to instantiate a <see cref="TrackingEngine"/> type directly /// instead of making a call to <see cref="Create"/>. This is to prevent poor programming /// practices and having multiple engines active at once with the same ID. /// </exception> protected TrackingEngine() { if (!CreatingEngine) { throw new InvalidOperationException("TrackingEngine instances must be created with TrackingEngine.Create(...)."); } UpdateUserAgent("SierraLib.Analytics", AssemblyInformation.GetAssemblyVersion().ToString(3), "UniversalAnalytics"); QueueLifeSpan = new TimeSpan(7, 0, 0, 0); RetryInterval = new TimeSpan(0, 1, 0); Enabled = true; RequestQueue.Where(x => x.Engine == this).ObserveOn(TaskPoolScheduler.Default).Subscribe(ProcessRequest); }
/// <summary> /// Gets a string representation of the tracking platform being used for the Platform and Platform Details components of the UserAgent string. /// http://en.wikipedia.org/wiki/User_agent#Format /// </summary> /// <returns>SierraLib.Analytics/1.0.0 (YourAnalyticsTracker)</returns> protected virtual string GetTrackerPlatformString() { return(string.Format("SierraLib.Analytics/{0} ({1})", AssemblyInformation.GetAssemblyVersion().ToString(3), this.GetType().Name)); }