public MetadataViewModel(MetadataContext context, SoapMetadata metadata)
{
if (context == null)
{
throw new ArgumentException("The metadata context was null.", "context");
}
if (metadata == null)
{
throw new ArgumentException("The metadata was null.", "metadata");
}
if (context.MetadataName != metadata.MetadataName)
{
throw new ArgumentException("The MetadataContext.MetadataName did not match the SoapMetadata.MetadataName, the context was not for this metadata.");
}
this._metadataName = context.MetadataName;
this._originalMetadataName = context.MetadataName;
if (context.NodeUid.HasValue)
{
this._nodeUid = context.NodeUid.Value;
}
if (context.RelationshipUid.HasValue)
{
this._relationshipUid = context.RelationshipUid.Value;
}
if (context.DescriptorTypeUid.HasValue)
{
this._descriptorTypeUid = context.DescriptorTypeUid.Value;
}
this._metadataTypeUid = metadata.MetadataType.Id;
this._metadataValue = metadata.MetadataValue;
}