コード例 #1
0
        private void RegisterServices()
        {
            using (var handle = Insights.TrackTime(AppMetrics.GetKeyForBootstrapperRegistrationTime("services")))
            {
                this.Log().Info("Registering Services...");

                // Locator.CurrentMutable.RegisterLazySingleton(() =>);

                this.Log().Info("Services have been registered.");
            }
        }
コード例 #2
0
        private void RegisterViewModels()
        {
            using (var handle = Insights.TrackTime(AppMetrics.GetKeyForBootstrapperRegistrationTime("viewmodels")))
            {
                this.Log().Info("Registering ViewModels...");

//                Locator.CurrentMutable.Register(() => new HomePage(), typeof(IViewFor<HomeViewModel>));

                this.Log().Info("ViewModels have been registered.");
            }
        }
コード例 #3
0
        private void RegisterAkavache()
        {
            using (var handle = Insights.TrackTime(AppMetrics.GetKeyForBootstrapperRegistrationTime("akavache")))
            {
                this.Log().Info("Registering Akavache cache storages...");

                BlobCache.ApplicationName = AppInfo.ApplicationName;
                BlobCache.LocalMachine    = new SQLitePersistentBlobCache(Path.Combine(AppInfo.BlobCachePath.Path, "application.db"));
                BlobCache.Secure          = new SQLiteEncryptedBlobCache(Path.Combine(AppInfo.BlobCachePath.Path, "secrets.db"));
                BlobCache.InMemory        = new InMemoryBlobCache();

                Locator.CurrentMutable.RegisterLazySingleton(() => new SQLitePersistentBlobCache(Path.Combine(AppInfo.BlobCachePath.Path, "session.db")),
                                                             typeof(IBlobCache), AppCacheKeys.SessionCacheContract);

                this.Log().Info("Akavache cache storages have been registered.");
            }
        }