Beispiel #1
0
        public async Task <IEnumerable <LoadOptions> > GetAll()
        {
            var list = new List <LoadOptions>();

            foreach (DynItem item in await _dynItemController.GetAll(typeof(LoadOptions)))
            {
                var loadOption = (LoadOptions)await _dynItemController.Create(item.ItemId);

                loadOption.Id = item.ItemId;
                list.Add(loadOption);
            }

            return(list);
        }
Beispiel #2
0
        public async Task <IEnumerable <Joystick> > GetAll()
        {
            var list = new List <Joystick>();

            foreach (DynItem item in await _dynItemController.GetAll(typeof(Joystick)))
            {
                var joystick = (Joystick)await _dynItemController.Create(item.ItemId);

                joystick.Id = item.ItemId;
                list.Add(joystick);
            }

            return(list);
        }
Beispiel #3
0
        public async Task <Tuple <Joystick, int> > Load()
        {
            var joystick = await _dynService.GetAll(typeof(Joystick));

            if (joystick != null && joystick.Any())
            {
                int id = joystick.First().ItemId;
                return(new Tuple <Joystick, int>((Joystick)await _dynService.Create(id), id));
            }

            return(new Tuple <Joystick, int>(new Joystick {
                BaudRate = 250000, ComPort = @"com7"
            }, -1));
        }