Ejemplo n.º 1
0
 private void AddToAircraftList(AircraftConfig item)
 {
     if (aircrafts.TryGetValue(item.Config.AC, out var acSameType))
     {
         acSameType.Add(item);
     }
     else
     {
         aircrafts.Add(item.Config.AC, List(item));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Find any file in folders which contains a profile with the specified registration.
        /// Returns null if failed to find or load.
        /// </summary>
        public static AircraftConfig Find(string registration)
        {
            foreach (var i in AllFiles)
            {
                try
                {
                    var config = new AircraftConfig(Load(i), i);
                    if (config.Config.Registration == registration)
                    {
                        return(config);
                    }
                }
                catch { }
            }

            return(null);
        }
Ejemplo n.º 3
0
 /// <exception cref="ArgumentException">The registration already exists.</exception>
 /// <exception cref="ArgumentNullException"></exception>
 public void Add(AircraftConfig item)
 {
     registrations.Add(item.Config.Registration, item);
     AddToAircraftList(item);
 }