示例#1
0
        public void SetUp()
        {
            service = Create <HandlerService>();

            service.Handlers.Add(new FakeHandler("one"));
            service.Handlers.Add(new FakeHandler("two"));
            service.Handlers.Add(new FakeHandler("three"));
        }
示例#2
0
        public void SetUp()
        {
            service = Create<HandlerService>();

            service.Handlers.Add(new FakeHandler("one"));
            service.Handlers.Add(new FakeHandler("two"));
            service.Handlers.Add(new FakeHandler("three"));
        }
示例#3
0
文件: Program.cs 项目: Olezhka/Hipbot
        /// <summary>
        /// Starts the HipBot application
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        public void Initialize(string[] args)
        {
            // Load MEF
            DoImport();

            // Register types
            Stencil.Defaults.Assemblies.Add(typeof(Room).Assembly);
            Stencil.Defaults.Assemblies.Add(typeof(Program).Assembly);
            Stencil.Defaults.Assemblies.Add(typeof(Stencil).Assembly);
            Stencil.Defaults.Assemblies.Add(typeof(ICommand).Assembly);

            // Register handlers
            foreach (var handler in Handlers)
            {
                Stencil.Defaults.Types.Add(handler.GetType());
            }

            Stencil.Instance.Initilize();

            // Start watching plugins
            InitializePluginWatcher();

            // Initilize handler service
            handlerService = Stencil.Instance.Resolve<IHandlerService>() as HandlerService;

            // Run latest version
            var service = Stencil.Instance.Resolve<UpdateService>();
            service.RunLatestVersion(true, false);

            // Get Console
            var console = Stencil.Instance.Resolve<HipBotConsole>();

            // Go!
            console.Run(args);
        }