Example #1
0
        private static void Initialize(IDestination destination, IBootstrapper bootstrapper)
        {
            TinyIoCContainer container = new TinyIoCContainer();
            NoomResolver     resolver  = new NoomResolver(container);

            NoomCache  cache  = new NoomCache();
            NoomTools  tools  = new NoomTools(resolver, cache);
            NoomRouter router = new NoomRouter();

            NoomNavigator navigator = new NoomNavigator(router, destination, tools);

            container.Register <ICache>(cache);
            container.Register <IRouter>(router);
            container.Register <INavigator>(navigator);
            container.Register <IResolver>(resolver);
            container.RegisterMultiple(typeof(IModule), bootstrapper.FindAllModules());

            foreach (Type type in bootstrapper.FindAllViews())
            {
                container.Register(type);
            }

            foreach (IModule module in container.ResolveAll <IModule>())
            {
                module.Register(router);
            }

            navigator.NavigateTo("/");
        }