예제 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // 參考物件
            var somethingService = new SomethingService();

            // Controller
            var sensorController = new SensorController();
            var workController   = new WorkController(somethingService);

            Application.Run(new Form1(sensorController, workController));
        }
예제 #2
0
        public void SetupDispatcher()
        {
            catchAllService       = new CatchAllService();
            errorService          = new ErrorService();
            somethingService      = new SomethingService();
            somethingErrorService = new SomethingErrorService();

            container = A.Fake <IContainer>();

            A.CallTo(() => container.ResolveAll <ISubscribe <IEvent> >())
            .Returns(new ISubscribe <IEvent>[] { catchAllService });

            A.CallTo(() => container.ResolveAll <ISubscribe <ErrorOccured> >())
            .Returns(new ISubscribe <ErrorOccured>[] { errorService, somethingErrorService });

            A.CallTo(() => container.ResolveAll <ISubscribe <SomethingHappened> >())
            .Returns(new ISubscribe <SomethingHappened>[] { somethingService, somethingErrorService });

            dispatcher = new ImmediateDispatcher(container);
        }
예제 #3
0
 public WorkController(SomethingService somethingService)
 {
     _somethingService = somethingService;
 }