Beispiel #1
0
        public override void PreInitialize()
        {
            IocManager.IocContainer.AddFacility <TypedFactoryFacility>();
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
            IocManager.Register <IUniqueIdentifierProvider, HddBasedIdentifierProvider>();
            IocManager.Register <IUniqueIdentifierProvider, CpuBasedIdentifierProvider>();
            IocManager.Resolve <DynamicTranslatorConfiguration>().Initialize();

            string existingToLanguage   = AppConfigManager.Get("ToLanguage");
            string existingFromLanguage = AppConfigManager.Get("FromLanguage");

            Configurations.ApplicationConfiguration.IsLanguageDetectionEnabled = true;
            Configurations.ApplicationConfiguration.IsExtraLoggingEnabled      = true;
            Configurations.ApplicationConfiguration.LeftOffset = 500;
            Configurations.ApplicationConfiguration.TopOffset  = 15;
            Configurations.ApplicationConfiguration.SearchableCharacterLimit = 200;
            Configurations.ApplicationConfiguration.IsNoSqlDatabaseEnabled   = true;
            Configurations.ApplicationConfiguration.MaxNotifications         = 4;
            Configurations.ApplicationConfiguration.ToLanguage   = new Language(existingToLanguage, LanguageMapping.All[existingToLanguage]);
            Configurations.ApplicationConfiguration.FromLanguage = new Language(existingFromLanguage, LanguageMapping.All[existingFromLanguage]);

            Configurations.ApplicationConfiguration.ClientConfiguration.CreateOrConsolidate(client =>
            {
                client.AppVersion  = ApplicationVersion.GetCurrentVersion();
                client.Id          = string.IsNullOrEmpty(AppConfigManager.Get("ClientId")) ? GenerateUniqueClientId() : AppConfigManager.Get("ClientId");
                client.MachineName = Environment.MachineName.Normalize();
            });

            Configurations.GoogleAnalyticsConfiguration.Url        = "http://www.google-analytics.com/collect";
            Configurations.GoogleAnalyticsConfiguration.TrackingId = "UA-70082243-2";

            Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
        }
Beispiel #2
0
 public void OnNext(long value)
 {
     Task.Run(() =>
     {
         _googleAnalyticsService.TrackAppScreenAsync("DynamicTranslator",
                                                     ApplicationVersion.GetCurrentVersion(),
                                                     "dynamictranslator",
                                                     "dynamictranslator",
                                                     "MainWindow");
     });
 }