private void setSimulator()
        {
            if (FsxManager.isConnected())
            {
                string name = FsxManager.getSimName();
                if (name.Equals("Microsoft Flight Simulator X"))
                {
                    int build = FsxManager.getSimBuildMajor();
                    if ((build == 62608) || (build == 62613) || (build == 62615))
                    {
                        setSimulatorFsxSe();
                    }
                    else
                    {
                        setSimulatorFsx();
                    }
                }
                else
                {
                    setSimulatorP3d();
                }

                txtSimName.Text             = name;
                txtSimName.Foreground       = Brushes.Black;
                txtSimVersion.Text          = "" + FsxManager.getSimVersionMajor() + "." + FsxManager.getSimVersionMinor();
                txtSimVersion.Foreground    = Brushes.Black;
                txtSimBuild.Text            = "" + FsxManager.getSimBuildMajor() + "." + FsxManager.getSimBuildMinor();
                txtSimBuild.Foreground      = Brushes.Black;
                txtSimConVersion.Text       = "" + FsxManager.getLibVersionMajor() + "." + FsxManager.getLibVersionMinor();
                txtSimConVersion.Foreground = Brushes.Black;
                txtSimConBuild.Text         = "" + FsxManager.getLibBuildMajor() + "." + FsxManager.getLibBuildMinor();
                txtSimConBuild.Foreground   = Brushes.Black;
            }
            else
            {
                setSimulatorNone();

                txtSimName.Text             = "(simulator)";
                txtSimName.Foreground       = Brushes.LightGray;
                txtSimVersion.Text          = "(version)";
                txtSimVersion.Foreground    = Brushes.LightGray;
                txtSimBuild.Text            = "(build)";
                txtSimBuild.Foreground      = Brushes.LightGray;
                txtSimConVersion.Text       = "(version)";
                txtSimConVersion.Foreground = Brushes.LightGray;
                txtSimConBuild.Text         = "(build)";
                txtSimConBuild.Foreground   = Brushes.LightGray;
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            sceHandler = new FsxManager.CsSimConnectEventHandler(mainSceHandler);
            FsxManager.addSimconnectHandler(sceHandler);
            mpStHandler = new MultiplayManager.CsMultiplayStatusHandler(mainMpStatusHandler);
            MultiplayManager.addStatusHandler(mpStHandler);
            mpDataHandler = new MultiplayManager.CsMultiplayDataChangedHandler(mainMpDataChangedHandler);
            MultiplayManager.addDataChangedHandler(mainMpDataChangedHandler);

            srvmgr_start();

            setSimulator();
            setAircraft();
            setMultiplay();
        }
        private void setAircraft()
        {
            if (FsxManager.isConnected())
            {
                txtCallsign.Text       = MultiplayManager.isOverrideCallsign() ? MultiplayManager.getCallsign() : FsxManager.getAtcId();
                txtCallsign.Foreground = Brushes.Black;
                txtTitle.Text          = FsxManager.getTitle();
                txtTitle.Foreground    = Brushes.Black;

                txtAtcId.Text                 = FsxManager.getAtcId();
                txtAtcId.Foreground           = Brushes.Black;
                txtAtcType.Text               = FsxManager.getAtcType();
                txtAtcType.Foreground         = Brushes.Black;
                txtAtcModel.Text              = FsxManager.getAtcModel();
                txtAtcModel.Foreground        = Brushes.Black;
                txtAtcAirline.Text            = FsxManager.getAtcAirline();
                txtAtcAirline.Foreground      = Brushes.Black;
                txtAtcFlightNumber.Text       = FsxManager.getAtcFlightnumber();
                txtAtcFlightNumber.Foreground = Brushes.Black;
            }
            else
            {
                txtCallsign.Text       = "(callsign)";
                txtCallsign.Foreground = Brushes.LightGray;
                txtTitle.Text          = "(aircraft title)";
                txtTitle.Foreground    = Brushes.LightGray;

                txtAtcId.Text                 = "(callsign)";
                txtAtcId.Foreground           = Brushes.LightGray;
                txtAtcType.Text               = "(type)";
                txtAtcType.Foreground         = Brushes.LightGray;
                txtAtcModel.Text              = "(model)";
                txtAtcModel.Foreground        = Brushes.LightGray;
                txtAtcAirline.Text            = "(airline)";
                txtAtcAirline.Foreground      = Brushes.LightGray;
                txtAtcFlightNumber.Text       = "(flightnumber)";
                txtAtcFlightNumber.Foreground = Brushes.LightGray;
            }
        }