コード例 #1
0
 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;
 }