Click or drag to resize
IFlightSimulatorX Interface
The interface for objects that can talk to Microsoft's Flight Simulator X for us.

Namespace: VirtualRadar.Interface.FlightSimulatorX
Assembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public interface IFlightSimulatorX : IDisposable

The IFlightSimulatorX type exposes the following members.

Properties
  NameDescription
Public propertyConnected
Gets a value indicating whether we are connected to Flight Simulator X or not.
Public propertyConnectionStatus
Gets a description of the state of the connection to FSX.
Public propertyIsFrozen
Gets or sets a value indicating that the simulated aircraft's position, altitude and attitude are frozen in FSX. When an aircraft is frozen it is unable to move but FSX will register a collision if it hits an object or the ground.
Public propertyIsInstalled
Gets a value indicating that Flight Simulator X appears to be installed.
Public propertyIsSlewing
Gets or sets a value indicating that the simulator is in slew mode. In slew mode the aircraft does not fly normally but the pitch is still affected by the simulated environment. FSX will ignore collisions with objects or the ground.
Public propertyMessagesReceivedCount
Gets a count of messages that have been sent from FSX.
Top
Methods
  NameDescription
Public methodConnect
Connects to Flight Simulator X.
Public methodDisconnect
Disconnects from Flight Simulator X.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
Public methodCode exampleIsSimConnectMessage
Returns true if the Windows message is a SimConnect message from Flight Simulator X.
Public methodMoveAircraft
Tells Flight Simulator to move the simulated aircraft to the position specified.
Public methodRequestAircraftInformation
Sends a request to Flight Simulator for information about the simulated aircraft.
Top
Events
  NameDescription
Public eventAircraftInformationReceived
Public eventConnectionStatusChanged
Raised whenever ConnectionStatus changes.
Public eventFlightSimulatorXExceptionRaised
Raised whenever Flight Simulator raises an exception.
Public eventFreezeStatusChanged
Raised whenever IsFrozen changes.
Public eventSlewStatusChanged
Raised whenever IsSlewing changes.
Public eventSlewToggled
Raised whenever the user manually toggles slew mode within the game.
Top
Remarks
SimConnect sends messages to another application via Windows messages, so we need to have access to a WndProc for this to work. The .NET framework doesn't make it easy to get at the WndProc for a form directly, you need to inherit from the form to do so. We could use interop and just do it the old-fashioned way but it feels a bit naughty-naughty, so instead the caller should call IsSimConnectMessage(Message) for every message they receive and do nothing if it returns true.
See Also