/// <summary>
/// Sets the member of dom specified by name to val.
/// If a member with the specified name does not exist an ArgumentException will be thrown.
/// </summary>
public void SetValue(DocumentObject dom, string name, object val)
{
int dot = name.IndexOf('.');
if (dot == 0)
{
throw new ArgumentException(DomSR.InvalidValueName(name));
}
string trail = null;
if (dot > 0)
{
trail = name.Substring(dot + 1);
name = name.Substring(0, dot);
}
ValueDescriptor vd = this.vds[name];
if (vd == null)
{
throw new ArgumentException(DomSR.InvalidValueName(name));
}
if (trail != null)
{
//REVIEW DaSt: dom.GetValue(name) und rekursiv SetValue aufrufen,
// oder dom.GetValue(name.BisVorletzteElement) und erst SetValue aufrufen.
DocumentObject doc = dom.GetValue(name) as DocumentObject;
doc.SetValue(trail, val);
}
else
{
vd.SetValue(dom, val);
}
}