ChangeType() public method

public ChangeType ( object value, Type targetType ) : object
value object
targetType System.Type
return object
Esempio n. 1
0
 internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)
 {
     return MatchEnumeration((string)datatype.ChangeType(value, XTypedServices.typeOfString), enumeration, datatype);
 }
Esempio n. 2
0
 private bool MatchEnumeration(double value, ArrayList enumeration, XmlSchemaDatatype datatype)
 {
     foreach (object correctValue in enumeration)
     {
         if (value == (double)datatype.ChangeType(correctValue, typeof(double)))
         {
             return true;
         }
     }
     return false;
 }
Esempio n. 3
0
 internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)
 {
     return MatchEnumeration((DateTime)datatype.ChangeType(value, typeof(DateTime)), enumeration, datatype);
 }
Esempio n. 4
0
 internal bool MatchEnumeration(decimal value, ArrayList enumeration, XmlSchemaDatatype datatype) {
     
     foreach (object correctValue in enumeration)
     {
         if (value == (decimal)datatype.ChangeType(correctValue, typeof(decimal)))
         {
             return true;
         }
     }
     return false;
 }