Ejemplo n.º 1
0
        private void AddPlanesInfoByPath(string planePath)
        {
            try
            {
                for (int i = 0; i < 100; i++)
                {
                    string session = string.Format("fltsim.{0}", i);
                    AirplanesInfo planeInfo = new AirplanesInfo();

                    planeInfo.Title = GetFileProperty(planePath, session, "title");
                    planeInfo.AirlineName = GetFileProperty(planePath, session, "airline_name");
                    planeInfo.AtcAirline = GetFileProperty(planePath, session, "atc_airline");
                    planeInfo.AtcFlightNumber = GetFileProperty(planePath, session, "atc_flight_number");
                    planeInfo.AtcId = GetFileProperty(planePath, session, "atc_id");
                    planeInfo.AtcParkingCodes = GetFileProperty(planePath, session, "atc_parking_codes");
                    planeInfo.Description = GetFileProperty(planePath, session, "description");
                    planeInfo.Texture = GetFileProperty(planePath, session, "texture");
                    planeInfo.UiCreatedby = GetFileProperty(planePath, session, "ui_createdby");
                    planeInfo.UiManufacturer = GetFileProperty(planePath, session, "ui_manufacturer");
                    planeInfo.UiType = GetFileProperty(planePath, session, "ui_type");
                    planeInfo.UiTypeRole = GetFileProperty(planePath, session, "ui_typerole");
                    planeInfo.UiVariation = GetFileProperty(planePath, session, "ui_variation");

                    planeInfo.PathAircraftCFG = planePath;

                    if (string.IsNullOrEmpty(planeInfo.Title.Trim()))
                    {
                        break;
                    }

                    _lstAirplanes.Add(planeInfo.Title, planeInfo);
                }
                SetLabelValue(lblAmountPlanes, "( " + _lstAirplanes.Count + " )");
            }
            catch (Exception ex)
            {
                MessageBox.Show(_msgUnexpectedErro + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 public UiIcon(AirplanesInfo airplanesInfo)
 {
     InitializeComponent();
     _airplanesInfo = airplanesInfo;
     BindInfo();
 }