示例#1
0
        public override void Init(IComponentContainer c)
        {
            base.Init(c);

            var kernel = Container.Instance.Get <IKernel>();

            kernel.Configure(new InlineModule(
                                 b => b.Bind <IAvatarLoader, AvatarLoader>().InSingletonScope()));

            var loader = kernel.Get <IAvatarLoader>();
            var mask   = "Images/avatar_holder.png";

            loader.Init(1024, 1024, 100, 100, 5, mask);
            var cs = kernel.Get <CompactSerializer>();

            new CoreMessages(cs);
            new BaseMessages(cs);

            //c.Flow("start", "settings");
            c.Flow("start", "lobby");
            //c.Flow("splash-completed", "home");
            //c.Flow("show-menu", "login");
            //c.Flow("show-login", "login");

            //c.Register<SpashScene>("splash", true);
            //c.Register<HomeScene>("home", true);
            //c.Register<LeftMenu>("left", true);
            //c.Register<LoginScene>("login", true);

            //c.Register<SettingsScene>("settings", true);
            c.Register <LobbyScene>("lobby", true);
        }
示例#2
0
        /// <summary>
        /// Registers the type chain for all types in Susanoo.
        /// </summary>
        public virtual void Initialize()
        {
            Container.Register <IPropertyMetadataExtractor>(new ComponentModelMetadataExtractor());

            Container.Register <IDeserializerResolver>(new DeserializerResolver(
                                                           new KeyValuePairDeserializerFactory()));

            Container.Register <IDatabaseManagerFactory>(new DatabaseManagerFactory());

            //Processors

            //No need for a factory method here since NoResult is also NoDependency
            Container.Register <INoResultSetCommandProcessorFactory>(new NoResultSetCommandProcessorFactory());

            Container.Register <ISingleResultSetCommandProcessorFactory>((container)
                                                                         => new SingleResultSetCommandProcessorFactory(container.Resolve <IDeserializerResolver>()));

            Container.Register <IMultipleResultSetCommandProcessorFactory>((container)
                                                                           => new MultipleResultSetCommandProcessorFactory(container.Resolve <IDeserializerResolver>()));

            //Result Mapping
            Container.Register <ICommandMultipleResultExpressionFactory>((container)
                                                                         => new CommandMultipleResultExpressionFactory(
                                                                             container.Resolve <IPropertyMetadataExtractor>(),
                                                                             container.Resolve <IMultipleResultSetCommandProcessorFactory>()));

            Container.Register <ICommandSingleResultExpressionFactory>((container)
                                                                       => new CommandSingleResultExpressionFactory(
                                                                           container.Resolve <IPropertyMetadataExtractor>(),
                                                                           container.Resolve <ISingleResultSetCommandProcessorFactory>()));

            //Command Expression
            Container.Register <ICommandExpressionFactory>((container)
                                                           => new CommandExpressionFactory(
                                                               container.Resolve <IPropertyMetadataExtractor>(),
                                                               container.Resolve <INoResultSetCommandProcessorFactory>(),
                                                               container.Resolve <ICommandMultipleResultExpressionFactory>(),
                                                               container.Resolve <ICommandSingleResultExpressionFactory>()));

            Container.Register <ICommandBuilder>((container)
                                                 => new CommandBuilder(container.Resolve <ICommandExpressionFactory>()));
        }
 public void Initialize()
 {
     componentContainer.Register <IUrgenciaService, MockUrgenciaService>();
 }
示例#4
0
 public void Initialize()
 {
     componentContainer.Register <ICabeceraPacienteService, MockCabeceraPaciente>();
 }
示例#5
0
 private static void registerComponents(IComponentContainer container)
 {
     container.Register <IServerVariablesProvider>().To <ServerVariablesProvider>().AsSingleton();
 }
 /// <summary>
 /// Registra el type especificado en el genérico TTo como
 /// implementación de la interface pasada en TFrom.
 /// </summary>
 /// <typeparam name="TFrom">Interface del componente</typeparam>
 /// <typeparam name="TTo">Implementación del componente</typeparam>
 public void Register <TFrom, TTo>() where TTo : TFrom
 {
     _container.Register <TFrom, TTo>();
 }