C# Class Terradue.OpenSearch.OpenSearchParameterValueSet

Represents the search values related to an OpenSearch request and provides useful methods for managing and converting OpenSearch values.
ファイルを表示 Open project: Terradue/DotNetOpenSearch Class Usage Examples

Public Methods

Method Description
AddExtraParameter ( string name ) : void

Adds an extra parameter not defined by the OpenSearch description.

This method can be useful if there are unpublicized OpenSearch parameters that need to be set. In such cases it is necessary to add the parameter definition before setting its value.

FromOpenSearchDescription ( OpenSearchDescription osd, string format ) : OpenSearchParameterValueSet

Creates an OpenSearchParameterValueSet instance based on the specified OpenSearchDescriptionUrl object.

FromOpenSearchDescription ( OpenSearchDescriptionUrl osdUrl, XmlSerializerNamespaces namespaces = null ) : OpenSearchParameterValueSet

Creates an OpenSearchParameterValueSet instance based on the specified OpenSearchDescriptionUrl object.

FromOpenSearchDescription ( string template, OpenSearchDescriptionUrlParameter origParams = null, XmlSerializerNamespaces namespaces = null ) : OpenSearchParameterValueSet

Creates an OpenSearchParameterValueSet instance based on the specified OpenSearch template and optional additional parameter information.

GetQueryString ( bool allParameters ) : string

Gets a NameValueCollection representing the parameters and their values.

GetValues ( bool allParameters ) : NameValueCollection

Gets a NameValueCollection representing the parameters and their values.

GetValuesByIdentifier ( string identifier ) : string[]

Returns the values of the parameter specified by its identifier.

GetValuesByIdentifier ( string namespaceUri, string localName ) : string[]

Returns the values of the parameter specified by its identifier namespace URI and local name.

GetValuesByName ( string name ) : string[]

Returns the values of the parameter specified by its name.

SetValueByIdentifier ( string identifier, string value ) : void

Sets the value for the OpenSearch parameter specified by its identifier.

SetValueByIdentifier ( string namespaceUri, string localName, string value ) : void

Sets the value for the OpenSearch parameter specified by its identifier namespace URI and local name.

SetValueByName ( string name, string value ) : void

Sets the value for the OpenSearch parameter specified by its name.

SetValues ( NameValueCollection values ) : void

Sets the parameter values based on the specified NameValueCollection.

Only matching parameters are taken into account. The match is made by the query string name of the parameter.

SetValuesByIdentifier ( string identifier, IEnumerable values ) : void

Sets multiple values for the OpenSearch parameter specified by its identifier.

SetValuesByIdentifier ( string namespaceUri, string localName, IEnumerable values ) : void

Sets multiple values for the OpenSearch parameter specified by its identifier namespace URI and local name.

SetValuesByName ( string name, IEnumerable values ) : void

Sets multiple values for the OpenSearch parameter specified by its name.

TranslateFrom ( OpenSearchParameterValueSet source, bool verifyNamespaces = false ) : void

Sets the parameter values based on the values of another instance.

Only matching parameters are taken into account. The match is made by the fully qualified identifier of the OpenSearch parameters. In the default case it is assumed that the namespace prefixes used for the identifiers refer to the same namespaces in both value sets, however, the namespaces can be verified fully.

Protected Methods

Method Description
OpenSearchParameterValueSet ( ) : System

Method Details

AddExtraParameter() public method

Adds an extra parameter not defined by the OpenSearch description.
This method can be useful if there are unpublicized OpenSearch parameters that need to be set. In such cases it is necessary to add the parameter definition before setting its value.
public AddExtraParameter ( string name ) : void
name string The name of the parameter.
return void

FromOpenSearchDescription() public static method

Creates an OpenSearchParameterValueSet instance based on the specified OpenSearchDescriptionUrl object.
public static FromOpenSearchDescription ( OpenSearchDescription osd, string format ) : OpenSearchParameterValueSet
osd Terradue.OpenSearch.Schema.OpenSearchDescription
format string
return OpenSearchParameterValueSet

FromOpenSearchDescription() public static method

Creates an OpenSearchParameterValueSet instance based on the specified OpenSearchDescriptionUrl object.
public static FromOpenSearchDescription ( OpenSearchDescriptionUrl osdUrl, XmlSerializerNamespaces namespaces = null ) : OpenSearchParameterValueSet
osdUrl Terradue.OpenSearch.Schema.OpenSearchDescriptionUrl An OpenSearchDescriptionUrl object from a deserialized OpenSearch description document.
namespaces System.Xml.Serialization.XmlSerializerNamespaces
return OpenSearchParameterValueSet

FromOpenSearchDescription() public static method

Creates an OpenSearchParameterValueSet instance based on the specified OpenSearch template and optional additional parameter information.
public static FromOpenSearchDescription ( string template, OpenSearchDescriptionUrlParameter origParams = null, XmlSerializerNamespaces namespaces = null ) : OpenSearchParameterValueSet
template string An OpenSearch template URL.
origParams Terradue.OpenSearch.Schema.OpenSearchDescriptionUrlParameter
namespaces System.Xml.Serialization.XmlSerializerNamespaces
return OpenSearchParameterValueSet

GetQueryString() public method

Gets a NameValueCollection representing the parameters and their values.
public GetQueryString ( bool allParameters ) : string
allParameters bool If set to true, the NameValueCollection includes also unset parameters.
return string

GetValues() public method

Gets a NameValueCollection representing the parameters and their values.
public GetValues ( bool allParameters ) : NameValueCollection
allParameters bool If set to true, the NameValueCollection includes also unset parameters.
return System.Collections.Specialized.NameValueCollection

GetValuesByIdentifier() public method

Returns the values of the parameter specified by its identifier.
public GetValuesByIdentifier ( string identifier ) : string[]
identifier string The parameter identifier, i.e. the fully qualified identifier between the curly brackets in the OpenSearch description URL template, e.g. "geo:box".
return string[]

GetValuesByIdentifier() public method

Returns the values of the parameter specified by its identifier namespace URI and local name.
public GetValuesByIdentifier ( string namespaceUri, string localName ) : string[]
namespaceUri string The namespace URI part of the fully qualified identifier of this parameter as defined in the OpenSearch description URL template, e.g. "http://a9.com/-/opensearch/extensions/geo/1.0/".
localName string The local name part of the fully qualified identifier of this parameter as defined in the OpenSearch description URL template, e.g. "box".
return string[]

GetValuesByName() public method

Returns the values of the parameter specified by its name.
public GetValuesByName ( string name ) : string[]
name string The parameter name, as in the query string.
return string[]

OpenSearchParameterValueSet() protected method

protected OpenSearchParameterValueSet ( ) : System
return System

SetValueByIdentifier() public method

Sets the value for the OpenSearch parameter specified by its identifier.
public SetValueByIdentifier ( string identifier, string value ) : void
identifier string The parameter identifier, i.e. the fully qualified identifier between the curly brackets in the OpenSearch description URL template, e.g. "geo:box".
value string The value.
return void

SetValueByIdentifier() public method

Sets the value for the OpenSearch parameter specified by its identifier namespace URI and local name.
public SetValueByIdentifier ( string namespaceUri, string localName, string value ) : void
namespaceUri string The namespace URI part of the fully qualified identifier of this parameter as defined in the OpenSearch description URL template, e.g. "http://a9.com/-/opensearch/extensions/geo/1.0/".
localName string The local name part of the fully qualified identifier of this parameter as defined in the OpenSearch description URL template, e.g. "box".
value string The value.
return void

SetValueByName() public method

Sets the value for the OpenSearch parameter specified by its name.
public SetValueByName ( string name, string value ) : void
name string The parameter name, as in the query string.
value string
return void

SetValues() public method

Sets the parameter values based on the specified NameValueCollection.
Only matching parameters are taken into account. The match is made by the query string name of the parameter.
public SetValues ( NameValueCollection values ) : void
values System.Collections.Specialized.NameValueCollection The NameValueCollection containing the values to be used.
return void

SetValuesByIdentifier() public method

Sets multiple values for the OpenSearch parameter specified by its identifier.
public SetValuesByIdentifier ( string identifier, IEnumerable values ) : void
identifier string The parameter identifier, i.e. the fully qualified identifier between the curly brackets in the OpenSearch description URL template, e.g. "geo:box".
values IEnumerable An array containing the values.
return void

SetValuesByIdentifier() public method

Sets multiple values for the OpenSearch parameter specified by its identifier namespace URI and local name.
public SetValuesByIdentifier ( string namespaceUri, string localName, IEnumerable values ) : void
namespaceUri string The namespace URI part of the fully qualified identifier of this parameter as defined in the OpenSearch description URL template, e.g. "http://a9.com/-/opensearch/extensions/geo/1.0/".
localName string The local name part of the fully qualified identifier of this parameter as defined in the OpenSearch description URL template, e.g. "box".
values IEnumerable
return void

SetValuesByName() public method

Sets multiple values for the OpenSearch parameter specified by its name.
public SetValuesByName ( string name, IEnumerable values ) : void
name string The parameter name, as in the query string.
values IEnumerable An array containing the values.
return void

TranslateFrom() public method

Sets the parameter values based on the values of another instance.
Only matching parameters are taken into account. The match is made by the fully qualified identifier of the OpenSearch parameters. In the default case it is assumed that the namespace prefixes used for the identifiers refer to the same namespaces in both value sets, however, the namespaces can be verified fully.
public TranslateFrom ( OpenSearchParameterValueSet source, bool verifyNamespaces = false ) : void
source OpenSearchParameterValueSet The OpenSearchParameterValueSet that serves as source.
verifyNamespaces bool If set to true, the parameters are matched by namespace URI and local name, rather than just prefix and local name. The default is false.
return void