/// <summary> /// Raises <see cref="ExceptionRaised"/>. /// </summary> /// <param name="args"></param> private void OnExceptionRaised(SimConnectExceptionRaisedEventArgs args) { if (ExceptionRaised != null) { ExceptionRaised(this, args); } }
/// <summary> /// Called when SimConnect receives an exception notification from FSX. /// </summary> private void SimConnect_ExceptionRaised(object sender, SimConnectExceptionRaisedEventArgs args) { OnFlightSimulatorXExceptionRaised(new EventArgs <FlightSimulatorXException>(new FlightSimulatorXException( args.ExceptionCode, args.ParameterIndex, args.SendId ))); }
/// <summary> /// Called when SimConnect throws an exception. /// </summary> /// <param name="sender"></param> /// <param name="data"></param> private void SimConnect_RecvException(SimConnect sender, SIMCONNECT_RECV_EXCEPTION data) { var args = new SimConnectExceptionRaisedEventArgs() { ExceptionCode = data.dwException, ParameterIndex = data.dwIndex, SendId = data.dwSendID, ParameterIndexIsUnknown = data.dwIndex == SIMCONNECT_RECV_EXCEPTION.UNKNOWN_INDEX, SendIdIsUnknown = data.dwSendID == SIMCONNECT_RECV_EXCEPTION.UNKNOWN_SENDID, }; OnExceptionRaised(args); }
/// <summary> /// Raises <see cref="ExceptionRaised"/>. /// </summary> /// <param name="args"></param> private void OnExceptionRaised(SimConnectExceptionRaisedEventArgs args) { EventHelper.Raise(ExceptionRaised, this, args); }