public IEncodeable ReadEncodeable(
string fieldName,
System.Type systemType)
{
if (systemType == null) throw new ArgumentNullException("systemType");
object token = null;
if (!ReadField(fieldName, out token))
{
return null;
}
IEncodeable value = Activator.CreateInstance(systemType) as IEncodeable;
if (value == null)
{
throw new ServiceResultException(StatusCodes.BadDecodingError, Utils.Format("Type does not support IEncodeable interface: '{0}'", systemType.FullName));
}
try
{
m_stack.Push(token);
value.Decode(this);
}
finally
{
m_stack.Pop();
}
return value;
}