Terradue.OpenSearch.OpenSearchParameterValueSet.TranslateFrom C# (CSharp) Method

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
        public void TranslateFrom(OpenSearchParameterValueSet source, bool verifyNamespaces = false)
        {
            foreach (string identifier in parametersByIdentifier.Keys) {
                OpenSearchParameterDefinition paramDef = parametersByIdentifier[identifier];
                string[] sourceValues;
                if (verifyNamespaces && paramDef.IdentifierNamespaceUri != null) {
                    sourceValues = source.GetValuesByIdentifier(paramDef.IdentifierNamespaceUri, paramDef.IdentifierLocalName);
                } else {
                    sourceValues = source.GetValuesByIdentifier(identifier);
                }
                if (sourceValues != null) this.values[parametersByIdentifier[identifier]] = sourceValues;
            }
        }