public bool Connect() { lock ("connect") { SimVersion = FSVersion.None; FSUIPC_Close(); FSUIPC_Initialization(); int result = 0; // próba połączenia z FS2004 if (FSUIPC_Open(SIM_FS2K4, ref result)) { SimVersion = FSVersion.FS2004; return(true); } FSUIPC_Close(); FSUIPC_Initialization(); result = 0; // próba połączenia z FSX if (FSUIPC_Open(SIM_FSX, ref result)) { SimVersion = FSVersion.FSX; return(true); } return(false); } }
public void Save(XmlTextWriter xml) { xml.WriteElementString("fsVersion", FSVersion.ToString()); xml.WriteElementString("interval", Interval.ToString()); }