Exemple #1
0
        /// <summary>
        /// Registers the set of services in the specified <paramref name="container" />.
        /// </summary>
        /// <param name="container">The container the set of services is registered into.</param>
        public void RegisterServices(Container container)
        {
            container.Register <IThemeType, ThemeType>();
            container.Register <IGameType, GameType>();
            container.RegisterSingleton <IDatabase, Database>();
            container.InterceptWith <PropertyChangedInterceptor <IDatabase> >(x => x == typeof(IDatabase), true);

            var tracker = new Jot.Tracker(new JsonStore());

            tracker.Configure <Database>().PersistOn(PropChanged);
            container.RegisterInitializer(d =>
            {
                tracker.Track(d.Instance);
            }, ctx => ctx.Registration.ImplementationType == typeof(Database));

            container.Register <IStorageProvider, Storage>();
        }