ChangeType() public method

public ChangeType ( object value, Type targetType ) : object
value object
targetType System.Type
return object
示例#1
0
 internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)
 {
     return MatchEnumeration((string)datatype.ChangeType(value, XTypedServices.typeOfString), enumeration, datatype);
 }
示例#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;
 }
示例#3
0
 internal override bool MatchEnumeration(object value, ArrayList enumeration, XmlSchemaDatatype datatype)
 {
     return MatchEnumeration((DateTime)datatype.ChangeType(value, typeof(DateTime)), enumeration, datatype);
 }
示例#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;
 }