public LedControllerClient()
 {
     _engine = new Engine();
     _engine.RefreshSurfaceRequested += _engine_RefreshSurfaceRequested;
     _drawerService       = new DrawerService();
     _touchHandlerService = new TouchHandlerService();
 }
예제 #2
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            var hero = new Hero();

            var heroService      = new UpdaterService();
            var removerService   = new RemoverService();
            var drawerService    = new DrawerService((int)Width, (int)Height);
            var contrllerService = new KeyboardControllerService {
                Controllable = hero
            };

            var world = World.Instance;

            world.OnUpdate = () => Application.Current.Dispatcher.Invoke(() => MainScreen.Source = drawerService.DrawableBytes.ToBitmapSource());
            world.AddService(heroService);
            world.AddService(removerService);
            world.AddService(drawerService);
            world.AddService(contrllerService);
            world.AddEntity(hero);
            world.Start();

//            var client = new RoverClient("localhost", 12321) {
//                OnMapMessage = message => Application.Current.Dispatcher.Invoke(() => MainScreen.Source = message.DrawableBytes.ToBitmapSource())
//            };
//
//            client.ControllerService = new KeyboardControllerService {Controllable = new HeroAdapter(client)};
        }
예제 #3
0
        private async Task addEvent()
        {
            this.visible = true;
            var options = new DrawerOptions()
            {
                Title        = "AddNewEvent",
                MaskClosable = false,
                Width        = 350,
            };

            var drawerRef = await DrawerService.CreateAsync <AnimalEventDrawer, string, AnimalEvent>(options, null);

            drawerRef.OnClosed = async result =>
            {
                Console.WriteLine("OnAfterClosed:" + result);
                //if (result != null)
                //     value = result;
                await InvokeAsync(StateHasChanged);
            };
        }
예제 #4
0
 public MainScreenPresenter(MainScreen window, DrawerService drawerService)
 {
     this.window        = window;
     this.drawerService = drawerService;
     lines = drawerService.CreateBool("Show Lines");
 }
예제 #5
0
 public TaskDetailServices(DrawerService drawerSvr)
 {
     DrawerSvr = drawerSvr;
 }