Class StacAccessorsHelpers
Helper class for accessing properties in Stac objects
Inheritance
Namespace: Stac
Assembly: DotNetStac.dll
Syntax
public static class StacAccessorsHelpers : object
Methods
| Improve this Doc View SourceAddRange<T>(ICollection<T>, IEnumerable<T>)
Adds a range of items to the collection.
Declaration
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection. |
IEnumerable<T> | items | The items. |
Type Parameters
Name | Description |
---|---|
T | the type of the collection |
ChangeType<T>(Object)
Changes the type.
Declaration
public static T ChangeType<T>(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
T | the changed type value |
Type Parameters
Name | Description |
---|---|
T | the type of the property |
GetChildrenLinks(IStacParent)
Gets the children links.
Declaration
public static IEnumerable<StacLink> GetChildrenLinks(this IStacParent stacCatalog)
Parameters
Type | Name | Description |
---|---|---|
IStacParent | stacCatalog | The stac parent. |
Returns
Type | Description |
---|---|
IEnumerable<StacLink> | the children links |
GetCollection(StacItem)
Gets the collection of the Item as a StacLink
Declaration
public static StacLink GetCollection(this StacItem stacItem)
Parameters
Type | Name | Description |
---|---|---|
StacItem | stacItem | The stac item. |
Returns
Type | Description |
---|---|
StacLink | a Stac Link |
GetItemLinks(IStacParent)
Gets the item links.
Declaration
public static IEnumerable<StacLink> GetItemLinks(this IStacParent stacCatalog)
Parameters
Type | Name | Description |
---|---|---|
IStacParent | stacCatalog | The stac parent. |
Returns
Type | Description |
---|---|
IEnumerable<StacLink> | the item links |
GetObservableCollectionProperty<T>(IStacPropertiesContainer, String)
Gets the property as an observable collection.
Declaration
public static PropertyObservableCollection<T> GetObservableCollectionProperty<T>(this IStacPropertiesContainer propertiesContainer, string key)
Parameters
Type | Name | Description |
---|---|---|
IStacPropertiesContainer | propertiesContainer | The properties container. |
System.String | key | The key. |
Returns
Type | Description |
---|---|
PropertyObservableCollection<T> | the property collection |
Type Parameters
Name | Description |
---|---|
T | the type of the property |
GetProperty(IDictionary<String, Object>, String)
Gets the property.
Declaration
public static object GetProperty(this IDictionary<string, object> properties, string key)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | properties | The properties dictionary. |
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Object | the property value |
GetProperty(IStacPropertiesContainer, String)
Gets the property.
Declaration
public static object GetProperty(this IStacPropertiesContainer propertiesContainer, string key)
Parameters
Type | Name | Description |
---|---|---|
IStacPropertiesContainer | propertiesContainer | The stac properties container. |
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Object | the property value |
GetProperty<T>(IDictionary<String, Object>, String)
Gets the property.
Declaration
public static T GetProperty<T>(this IDictionary<string, object> properties, string key)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | properties | The properties dictionary. |
System.String | key | The key. |
Returns
Type | Description |
---|---|
T | the property value |
Type Parameters
Name | Description |
---|---|
T | the type of the property |
GetProperty<T>(IStacPropertiesContainer, String)
Gets the property.
Declaration
public static T GetProperty<T>(this IStacPropertiesContainer propertiesContainer, string key)
Parameters
Type | Name | Description |
---|---|---|
IStacPropertiesContainer | propertiesContainer | The stac properties container. |
System.String | key | The key. |
Returns
Type | Description |
---|---|
T | the property value |
Type Parameters
Name | Description |
---|---|
T | the type of the property |
Insert<T>(ICollection<T>, Int32, T)
Inserts the item at the specified index in the collection.
Declaration
public static void Insert<T>(this ICollection<T> collection, int index, T item)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection. |
System.Int32 | index | The index. |
T | item | The item. |
Type Parameters
Name | Description |
---|---|
T | the type of the collection |
LazyEnumParse(Type, String)
Parse an enum value from a string with a fallback to the many attributes that can be used to define an enum value
Declaration
public static object LazyEnumParse(Type t, string value)
Parameters
Type | Name | Description |
---|---|---|
Type | t | the enum type |
System.String | value | the string value |
Returns
Type | Description |
---|---|
System.Object | the enum value |
RemoveProperty(IDictionary<String, Object>, String)
Removes the property.
Declaration
public static void RemoveProperty(this IDictionary<string, object> properties, string key)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | properties | The properties dictionary. |
System.String | key | The key. |
RemoveProperty(IStacPropertiesContainer, String)
Removes the property.
Declaration
public static void RemoveProperty(this IStacPropertiesContainer propertiesContainer, string key)
Parameters
Type | Name | Description |
---|---|---|
IStacPropertiesContainer | propertiesContainer | The stac properties container. |
System.String | key | The key. |
SetCollection(StacItem, String, Uri, String)
Set the id of the STAC Collection this Item references to see collection relation type.
Declaration
public static void SetCollection(this StacItem stacItem, string collectionId, Uri collectionUri, string collectionTitle = null)
Parameters
Type | Name | Description |
---|---|---|
StacItem | stacItem | stacItem to set the collection to |
System.String | collectionId | identifier of the collection |
Uri | collectionUri | uri to the collection |
System.String | collectionTitle | optional title of the collection |
SetProperty(IDictionary<String, Object>, String, Object)
Sets the property.
Declaration
public static void SetProperty(this IDictionary<string, object> properties, string key, object value)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | properties | The properties dictionary. |
System.String | key | The key. |
System.Object | value | The value. |
SetProperty(IStacObject, String, Object)
Sets the property.
Declaration
public static void SetProperty(this IStacObject stacObject, string key, object value)
Parameters
Type | Name | Description |
---|---|---|
IStacObject | stacObject | The stac object. |
System.String | key | The key. |
System.Object | value | The value. |
SetProperty(IStacPropertiesContainer, String, Object)
Sets the property.
Declaration
public static void SetProperty(this IStacPropertiesContainer stacPropertiesContainer, string key, object value)
Parameters
Type | Name | Description |
---|---|---|
IStacPropertiesContainer | stacPropertiesContainer | The stac properties container. |
System.String | key | The key. |
System.Object | value | The value. |
ToStringByAttributes(Object)
Get the string value of an enum value
Declaration
public static string[] ToStringByAttributes(this object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | the enum value |
Returns
Type | Description |
---|---|
System.String[] | the string value |