Esempio n. 1
0
 //removes a merger from the list
 public static void RemoveAirlineMerger(AirlineMerger merger)
 {
     mergers.Remove(merger);
 }
Esempio n. 2
0
 //adds a merger to the list of mergers
 public static void AddAirlineMerger(AirlineMerger merger)
 {
     mergers.Add(merger);
 }
Esempio n. 3
0
 //adds a merger to the list of mergers
 public static void AddAirlineMerger(AirlineMerger merger)
 {
     mergers.Add(merger);
 }
Esempio n. 4
0
 //removes a merger from the list
 public static void RemoveAirlineMerger(AirlineMerger merger)
 {
     mergers.Remove(merger);
 }
Esempio n. 5
0
        /*!loads the airline mergers
         */
        private static void LoadAirlineMergers()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(AppSettings.getDataPath() + "\\addons\\airlines\\mergers\\mergers.xml");
            XmlElement root = doc.DocumentElement;

            XmlNodeList mergersList = root.SelectNodes("//merger");

            foreach (XmlElement element in mergersList)
            {

                string mergerName = element.Attributes["name"].Value;
                Airline airline1 = Airlines.GetAirline(element.Attributes["airline1"].Value);
                Airline airline2 = Airlines.GetAirline(element.Attributes["airline2"].Value);
                AirlineMerger.MergerType mergerType = (AirlineMerger.MergerType)Enum.Parse(typeof(AirlineMerger.MergerType), element.Attributes["type"].Value);
                DateTime mergerDate = DateTime.Parse(element.Attributes["date"].Value, new CultureInfo("en-US", false));

                AirlineMerger merger = new AirlineMerger(mergerName, airline1, airline2, mergerDate, mergerType);

                if (element.HasAttribute("newname"))
                    merger.NewName = element.Attributes["newname"].Value;

                AirlineMergers.AddAirlineMerger(merger);

            }
        }