private void ChangeGyroscope(string[] gyroscope) { GyroscopeChangeEventArgs GyroscopeEvents = new GyroscopeChangeEventArgs(gyroscope); // Now, raise the event by invoking the delegate. Pass in // the objects that initiated the event (this) as wel as // AccelerationChangeEventArgs. // The call must match the signature of the AccelerationChangeEventHandler. if (GyroscopeChange != null) { GyroscopeChange(this, GyroscopeEvents); } }
void gyro_GyroscopeChange(object sender, GyroscopeChangeEventArgs e) { Gyroscope attached = (Gyroscope)sender; if (State == StateEnum.GYRO) { for (int index = 0; index < StaticUtilities.numberOfGyroscopeAxis; index++) { try { gyroscopeText(index, Convert.ToInt32(e.Gyroscope[index])); } catch { } } } }