/// <summary> /// Constructs DynamoAnalyticsClient with given DynamoModel /// </summary> /// <param name="dynamoModel">DynamoModel</param> public DynamoAnalyticsClient(DynamoModel dynamoModel) { //Set the preferences, so that we can get live value of analytics //reporting approved status. preferences = dynamoModel.PreferenceSettings; if (Session == null) { Session = new DynamoAnalyticsSession(); } //Setup Analytics service, StabilityCookie, Heartbeat and UsageLog. Session.Start(dynamoModel); //Dynamo app version. var appversion = dynamoModel.AppVersion; string buildId = "", releaseId = ""; Version version; if (Version.TryParse(dynamoModel.Version, out version)) { buildId = $"{version.Major}.{version.Minor}.{version.Build}"; // BuildId has the following format major.minor.build, ex: 2.5.1 releaseId = $"{version.Major}.{version.Minor}.0"; // ReleaseId has the following format: major.minor.0; ex: 2.5.0 } product = new ProductInfo() { Id = "DYN", Name = "Dynamo", VersionString = appversion, AppVersion = appversion, BuildId = buildId, ReleaseId = releaseId }; }
/// <summary> /// Starts the client when DynamoModel is created. This method initializes /// the Analytics service and application life cycle start is tracked. /// </summary> /// <param name="model"></param> public void Start(DynamoModel dynamoModel) { //Set the preferences, so that we can get live value of analytics //reporting approved status. preferences = dynamoModel.PreferenceSettings; if (Session == null) { Session = new DynamoAnalyticsSession(); } //Setup Analytics service, StabilityCookie, Heartbeat and UsageLog. Session.Start(dynamoModel); //Dynamo app version. var appversion = dynamoModel.AppVersion; //If not ReportingAnalytics, then set the idle time as infinite so idle state is not recorded. Service.StartUp(new ProductInfo() { Name = "Dynamo", VersionString = appversion }, new UserInfo(Session.UserId), ReportingAnalytics ? TimeSpan.FromMinutes(30) : TimeSpan.MaxValue); TrackPreferenceInternal("ReportingAnalytics", "", ReportingAnalytics ? 1 : 0); TrackPreferenceInternal("ReportingUsage", "", ReportingUsage ? 1 : 0); }
/// <summary> /// Constructs DynamoAnalyticsClient with given DynamoModel /// </summary> /// <param name="dynamoModel">DynamoModel</param> public DynamoAnalyticsClient(DynamoModel dynamoModel) { //Set the preferences, so that we can get live value of analytics //reporting approved status. preferences = dynamoModel.PreferenceSettings; if (Session == null) { Session = new DynamoAnalyticsSession(); } //Setup Analytics service, StabilityCookie, Heartbeat and UsageLog. Session.Start(dynamoModel); //Dynamo app version. var appversion = dynamoModel.AppVersion; product = new ProductInfo() { Name = "Dynamo", VersionString = appversion, AppVersion = dynamoModel.Version }; }
/// <summary> /// Constructs DynamoAnalyticsClient with given DynamoModel /// </summary> /// <param name="dynamoModel">DynamoModel</param> public DynamoAnalyticsClient(DynamoModel dynamoModel) { //Set the preferences, so that we can get live value of analytics //reporting approved status. preferences = dynamoModel.PreferenceSettings; if (Session == null) { Session = new DynamoAnalyticsSession(); } //Setup Analytics service, and StabilityCookie. Session.Start(dynamoModel); //Dynamo app version. var appversion = dynamoModel.AppVersion; var hostName = string.IsNullOrEmpty(dynamoModel.HostName) ? "Dynamo" : dynamoModel.HostName; hostInfo = new HostContextInfo() { ParentId = dynamoModel.HostAnalyticsInfo.ParentId, SessionId = dynamoModel.HostAnalyticsInfo.SessionId }; string buildId = String.Empty, releaseId = String.Empty; if (Version.TryParse(dynamoModel.Version, out Version version)) { buildId = $"{version.Major}.{version.Minor}.{version.Build}"; // BuildId has the following format major.minor.build, ex: 2.5.1 releaseId = $"{version.Major}.{version.Minor}.0"; // ReleaseId has the following format: major.minor.0; ex: 2.5.0 } product = new ProductInfo() { Id = "DYN", Name = hostName, VersionString = appversion, AppVersion = appversion, BuildId = buildId, ReleaseId = releaseId }; }
/// <summary> /// Starts the client when DynamoModel is created. This method initializes /// the Analytics service and application life cycle start is tracked. /// </summary> /// <param name="model"></param> public void Start(DynamoModel dynamoModel) { //Set the preferences, so that we can get live value of analytics //reporting approved status. preferences = dynamoModel.PreferenceSettings; if (Session == null) Session = new DynamoAnalyticsSession(); //Setup Analytics service, StabilityCookie, Heartbeat and UsageLog. Session.Start(dynamoModel); //Dynamo app version. var appversion = dynamoModel.AppVersion; //If not ReportingAnalytics, then set the idle time as infinite so idle state is not recorded. Service.StartUp(new ProductInfo() { Name = "Dynamo", VersionString = appversion }, new UserInfo(Session.UserId), ReportingAnalytics ? TimeSpan.FromMinutes(30) : TimeSpan.MaxValue); }
/// <summary> /// Constructs DynamoAnalyticsClient with given DynamoModel /// </summary> /// <param name="dynamoModel">DynamoModel</param> public DynamoAnalyticsClient(DynamoModel dynamoModel) { //Set the preferences, so that we can get live value of analytics //reporting approved status. preferences = dynamoModel.PreferenceSettings; if (Session == null) Session = new DynamoAnalyticsSession(); //Setup Analytics service, StabilityCookie, Heartbeat and UsageLog. Session.Start(dynamoModel); //Dynamo app version. var appversion = dynamoModel.AppVersion; product = new ProductInfo() { Name = "Dynamo", VersionString = appversion }; }