Ejemplo n.º 1
0
        static void OnMyoConnected(object sender, MyoEventArgs e)
        {
            _myos.Add(e.Myo);
            e.Myo.AccelerometerDataAcquired += OnAccelerationDataAcquired;
            e.Myo.OrientationDataAcquired   += OnOrientationDataAcquired;

            var args = new MyoRoutedEventArgs(MyoDevice.ConnectedEvent, sender, e.Myo, e.TimeStamp);

            RaiseEvent(MyoDevice.ConnectedEvent, args);
        }
Ejemplo n.º 2
0
        static void RaiseEvent(RoutedEvent ev, MyoRoutedEventArgs args)
        {
            if (Application.Current == null)
            {
                return;
            }

            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                foreach (var elem in _elements[ev])
                {
                    elem.RaiseEvent(args);
                }
            }));
        }
Ejemplo n.º 3
0
		static void OnMyoConnected(object sender, MyoEventArgs e)
		{
			_myos.Add(e.Myo);
			e.Myo.AccelerometerDataAcquired += OnAccelerationDataAcquired;
			e.Myo.OrientationDataAcquired += OnOrientationDataAcquired;

			var args = new MyoRoutedEventArgs(MyoDevice.ConnectedEvent, sender, e.Myo, e.TimeStamp);
			RaiseEvent(MyoDevice.ConnectedEvent, args);
		}
Ejemplo n.º 4
0
		static void RaiseEvent(RoutedEvent ev, MyoRoutedEventArgs args)
		{
			if (Application.Current == null) return;

			Application.Current.Dispatcher.Invoke(new Action(( ) =>
			{
				foreach (var elem in _elements[ev])
					elem.RaiseEvent(args);
			}));
		}