public Route(GTFSPropertyCollection properties) : base(properties, "route_id")
 {
     if (!properties.ContainsKey("route_short_name") && !properties.ContainsKey("route_long_name"))
     {
         throw new InvalidDataException("Routes must have either a long name or a short name.");
     }
     if (!properties.IsInt("route_type"))
     {
         throw new InvalidDataException("Routes must have a type.");
     }
 }
Esempio n. 2
0
        public static double GetDouble(this GTFSPropertyCollection properties, string key, double?def = null)
        {
            string input = properties[key];
            double?ret   = GetNullableDouble(input);

            if (ret.HasValue)
            {
                return(ret.Value);
            }
            if (def.HasValue)
            {
                return(def.Value);
            }
            throw new ArgumentException($"{input} could not be cast to a number.");
        }
Esempio n. 3
0
 public GTFSOrderedEntity(GTFSPropertyCollection properties, string idKey, string indexKey) : base(properties, properties[idKey], properties.GetInt(indexKey))
 {
     ID    = FirstKey;
     Index = SecondKey;
 }
 public FareRule(GTFSPropertyCollection properties) : base(properties)
 {
 }
Esempio n. 5
0
 public static bool IsColor(this GTFSPropertyCollection properties, string key) => IsColor(properties[key]);
Esempio n. 6
0
 public static Color GetColor(this GTFSPropertyCollection properties, string key, Color?def = null) => GetColor(properties[key], def);
Esempio n. 7
0
 public static bool?GetNullableBool(this GTFSPropertyCollection properties, string key) => GetNullableBool(properties[key]);
Esempio n. 8
0
 public static bool IsNonNegativeDouble(this GTFSPropertyCollection properties, string key) => IsNonNegativeDouble(properties[key]);
Esempio n. 9
0
 public static decimal?GetNullableNonNegativeDecimal(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeDecimal(properties[key]);
 public FeedInfo(GTFSPropertyCollection properties) : base(properties)
 {
 }
Esempio n. 11
0
 public Transfer(GTFSPropertyCollection properties) : base(properties, properties["from_stop_id"], properties["to_stop_id"])
 {
 }
Esempio n. 12
0
 public Attribution(GTFSPropertyCollection properties) : base(properties)
 {
 }
 public FareAttribute(GTFSPropertyCollection properties) : base(properties, "fare_id")
 {
 }
Esempio n. 14
0
 public Trip(GTFSPropertyCollection properties) : base(properties, "trip_id")
 {
 }
Esempio n. 15
0
 public Level(GTFSPropertyCollection properties) : base(properties, "level_id")
 {
 }
Esempio n. 16
0
 public static int?GetNullableNonNegativeInt(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeInt(properties[key]);
Esempio n. 17
0
 public static Color?GetNullableColor(this GTFSPropertyCollection properties, string key) => GetNullableColor(properties[key]);
Esempio n. 18
0
 public static LocalDate?GetNullableDate(this GTFSPropertyCollection properties, string key) => GetNullableDate(properties[key]);
Esempio n. 19
0
 public static double?GetNullableNonNegativeDouble(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeDouble(properties[key]);
Esempio n. 20
0
 public static LocalDate GetDate(this GTFSPropertyCollection properties, string key, LocalDate?def = null) => GetDate(properties[key], def);
Esempio n. 21
0
 public static void AssertNonNegativeDecimal(this GTFSPropertyCollection properties, string key) => AssertDecimal(properties[key], key);
Esempio n. 22
0
 public static Duration?GetNullableDuration(this GTFSPropertyCollection properties, string key) => GetNullableDuration(properties[key]);
Esempio n. 23
0
 public static void AssertForeignKeyExists <T>(this GTFSPropertyCollection properties, string key, GTFSOrderedEntityCollection <T> collection, string collectionName) where T : GTFSOrderedEntity
 => AssertForeignKeyExists(properties[key], key, collection, collectionName);
Esempio n. 24
0
 public static Duration GetDuration(this GTFSPropertyCollection properties, string key, Duration?def = null) => GetDuration(properties[key], def);
Esempio n. 25
0
 public static void AssertForeignKeyExists(this GTFSPropertyCollection properties, string key, GTFSCalendarCollection collection, string collectionName)
 => AssertForeignKeyExists(properties[key], key, collection, collectionName);
Esempio n. 26
0
 public static bool IsDuration(this GTFSPropertyCollection properties, string key) => IsNonNegativeInt(properties[key]);
Esempio n. 27
0
 public static void AssertColor(this GTFSPropertyCollection properties, string key) => AssertColor(properties[key], key);
Esempio n. 28
0
 public static DateTimeZone GetTimeZone(this GTFSPropertyCollection properties, string key) => GetTimeZone(properties[key]);
Esempio n. 29
0
 public Agency(GTFSPropertyCollection properties) : base(properties, "agency_id")
 {
 }
 public GTFSUnparsedEntity(GTFSPropertyCollection properties, Exception ex) : base(properties)
 {
     Exception = ex;
 }