//---------------------------------------------------------------------------------------------------------------------
/// <summary>Sets the parameter values based on the values of another instance.</summary>
/// <remarks>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.</remarks>
/// <param name="source">The OpenSearchParameterValueSet that serves as source.</param>
/// <param name="verifyNamespaces">If set to <c>true</c>, the parameters are matched by namespace URI and local name, rather than just prefix and local name. The default is <c>false</c>.</param>
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;
}
}