private TResult FsxOperation <TResult>(Func <TResult> action) { _fsuipc.FSUIPC_Initialization(); var errorCode = 0; _fsuipc.FSUIPC_Open(Fsuipc.SIM_FSX, ref errorCode); var result = action(); _fsuipc.FSUIPC_Close(); return(result); }
private void reconnect() { connect.FSUIPC_Close(); connect = new Fsuipc(); connect.FSUIPC_Initialization(); int errorCode = 0; if (!connect.FSUIPC_Open(0, ref errorCode)) { throw new Exception("Can't connect to FSUIPC! Error code = " + errorCode.ToString()); } else { isconnected = true; } reqCount = 0; }
public void UnInitialize() { _fsuipc.FSUIPC_Close(); }