Esempio 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);
		}
Esempio 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);
			}));
		}