Class Extensions
Contains common extensions for this GTFS library.
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public static class ExtensionsMethods
AddOrReplace(IStopTimeCollection, StopTime)
Adds or replaces an entity in the given collection.
Declaration
public static void AddOrReplace(this IStopTimeCollection collection, StopTime entity)Parameters
| IStopTimeCollection
        collection 
 | 
| StopTime
        entity 
 | 
AddOrReplace(ITransferCollection, Transfer)
Adds or replaces an entity in the given collection.
Declaration
public static void AddOrReplace(this ITransferCollection collection, Transfer entity)Parameters
| ITransferCollection
        collection 
 | 
| Transfer
        entity 
 | 
AddOrReplace<T>(IEntityCollection<T>, T)
Adds or replaces an entity in the given collection.
Declaration
public static void AddOrReplace<T>(this IEntityCollection<T> collection, T entity)where T : GTFSEntityParameters
| IEntityCollection<T>
        collection 
 | 
| T
        entity 
 | 
Type Parameters
| T 
 | 
AddOrReplace<T>(IUniqueEntityCollection<T>, T, Func<T, String>)
Adds or replaces an entity in the given collection.
Declaration
public static void AddOrReplace<T>(this IUniqueEntityCollection<T> collection, T entity, Func<T, string> getId)where T : GTFSEntityParameters
| IUniqueEntityCollection<T>
        collection 
 | 
| T
        entity 
 | 
| System.Func<T, System.String>
        getId 
 | 
Type Parameters
| T 
 | 
CopyTo(IGTFSFeed, IGTFSFeed)
Copies this feed to the given feed.
Declaration
public static void CopyTo(this IGTFSFeed thisFeed, IGTFSFeed feed)Parameters
| IGTFSFeed
        thisFeed 
 | 
| IGTFSFeed
        feed 
 | 
DistanceInMeter(Double, Double, Double, Double)
Calculates the distance in meter between the two given coordinates.
Declaration
public static double DistanceInMeter(double latitude1, double longitude1, double latitude2, double longitude2)Parameters
| System.Double
        latitude1 
 | 
| System.Double
        longitude1 
 | 
| System.Double
        latitude2 
 | 
| System.Double
        longitude2 
 | 
Returns
| System.Double 
 | 
FastParse(Char)
Parses a number from a char value.
Declaration
public static int FastParse(this char value)Parameters
| System.Char
        value 
 | 
Returns
| System.Int32 
 | 
FastParse(String, Int32, Int32)
Parses an integer number from a string at the given index and with the given length.
Declaration
public static int FastParse(this string value, int idx, int count)Parameters
| System.String
        value 
 | 
| System.Int32
        idx 
 | 
| System.Int32
        count 
 | 
Returns
| System.Int32 
 | 
FromUnixTime(Int64)
Converts a number of milliseconds from 1/1/1970 into a standard DateTime.
Declaration
public static DateTime FromUnixTime(this long milliseconds)Parameters
| System.Int64
        milliseconds 
 | 
Returns
| System.DateTime 
 | 
Merge(IGTFSFeed, IGTFSFeed)
Merges the content of the given feed with this feed by adding or replacing entities.
Declaration
public static void Merge(this IGTFSFeed thisFeed, IGTFSFeed feed)Parameters
| IGTFSFeed
        thisFeed 
 | 
| IGTFSFeed
        feed 
 | 
SplitIntoGroupsByGroupIdx<T>(IEnumerable<T>, Int32)
Splits the given list of entities into groups of size maxGroupCount.
Declaration
public static Dictionary<int, List<T>> SplitIntoGroupsByGroupIdx<T>(this IEnumerable<T> _self, int maxGroupCount = 900)Parameters
| System.Collections.Generic.IEnumerable<T>
        _self 
 | 
| System.Int32
        maxGroupCount 
 | 
Returns
| System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.List<T>> 
 | 
Type Parameters
| T 
 | 
ToArgbInt(String)
Converts a hex color string to an argb value.
Declaration
public static int ? ToArgbInt(this string value)Parameters
| System.String
        value 
 | 
Returns
| System.Nullable<System.Int32> 
 | 
ToHexColorString(Nullable<Int32>)
Converts an integer rgb color value to a hex color string.
Declaration
public static string ToHexColorString(this int ? value)Parameters
| System.Nullable<System.Int32>
        value 
 | 
Returns
| System.String 
 | 
ToInvariantString(Object)
Returns a string representing the object in a culture invariant way.
Declaration
public static string ToInvariantString(this object obj)Parameters
| System.Object
        obj 
 | 
Returns
| System.String 
 | 
ToUnixTime(DateTime)
Converts a standard DateTime into the number of milliseconds since 1/1/1970.
Declaration
public static long ToUnixTime(this DateTime date)Parameters
| System.DateTime
        date 
 | 
Returns
| System.Int64 
 |