Class EidoHelper
Helper functions for handling Emergency Incident Data Object (EIDO) JSON document objects.
Inheritance
Inherited Members
Namespace: Eido
Assembly: EidoLib.dll
Syntax
public static class EidoHelper
Fields
JsonSerSettings
JsonSerializerSettings to use when serializing or de-serializing an EIDO.
Declaration
public static JsonSerializerSettings JsonSerSettings
Field Value
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings |
Methods
DeserializeFromString<T>(String)
Deserializes a JSON string into an object.
Declaration
public static T DeserializeFromString<T>(string strJson)
Parameters
Type | Name | Description |
---|---|---|
System.String | strJson | Input string to deserialize |
Returns
Type | Description |
---|---|
T | Returns an object of the specified type if successful or null if an error occurred. |
Type Parameters
Name | Description |
---|---|
T | Specifies the type of the object to deserialize the JSON string into. |
FromString(String)
De-serializes a JSON string containing an EIDO to an EidoType object.
Declaration
public static EidoType FromString(string strJson)
Parameters
Type | Name | Description |
---|---|---|
System.String | strJson | Input JSON string. |
Returns
Type | Description |
---|---|
EidoType | Returns an EIDO if successful or null if an error occured. |
GetNenaTimestamp()
Gets the current time using the NENA Timestamp format specified in Section 2.3 of NENA-STA-010.3.
Declaration
public static string GetNenaTimestamp()
Returns
Type | Description |
---|---|
System.String | Returns the NENA formatted Timestamp |
GetNenaTimestamp(DateTime)
Gets the time using the NENA Timestamp format specified in Section 2.3 Timestamp of NENA-STA-010.3.
Declaration
public static string GetNenaTimestamp(DateTime Tm)
Parameters
Type | Name | Description |
---|---|---|
DateTime | Tm | Input DateTime to convert. |
Returns
Type | Description |
---|---|
System.String | Returns the NENA formatted Timestamp |
SerializeToString(Object)
Serializes an object into an indented JSON string.
Declaration
public static string SerializeToString(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Input object to serialize |
Returns
Type | Description |
---|---|
System.String | Returns an indented JSON string if no errors occurred. Returns null if an error occurred. |
ToJsonString(EidoType)
Serializes an EidoType object to a JSON string.
Declaration
public static string ToJsonString(EidoType EidoObj)
Parameters
Type | Name | Description |
---|---|---|
EidoType | EidoObj | Input object to serialize |
Returns
Type | Description |
---|---|
System.String | Returns a string containing the JSON of the EidoType |