Transformer.Read C# (CSharp) Method

Read() public method

This method is used to convert the string value given to an appropriate representation. This is used when an object is being deserialized from the XML document and the value for the string representation is required.
public Read ( String value, Class, type ) : Object
value String /// this is the string representation of the value ///
type Class, /// this is the type to convert the string value to ///
return Object
   public Object Read(String value, Class type) {
      Transform transform = Lookup(type);
      if(transform == null) {
         throw new TransformException("Transform of %s not supported", type);
      }
      return transform.Read(value);
   }
   /// <summary>

Usage Example

Example #1
0
 /// <summary>
 /// This method is used to convert the string value given to an
 /// appropriate representation. This is used when an object is
 /// being deserialized from the XML document and the value for
 /// the string representation is required.
 /// </summary>
 /// <param name="value">
 /// this is the string representation of the value
 /// </param>
 /// <param name="type">
 /// this is the type to convert the string value to
 /// </param>
 /// <returns>
 /// this returns an appropriate instanced to be used
 /// </returns>
 public Object Read(String value, Class type)
 {
     return(transform.Read(value, type));
 }