Definition at line 896 of file Enum.cs.
  897    {
  900        {
  901            throw new ArgumentNullException("value");
  902        }
  904        {
  905            throw new ArgumentNullException("format");
  906        }
  909        {
  910            if (!
type.IsEquivalentTo(enumType))
 
  911            {
  913            }
  915            {
  916                throw new FormatException(SR.Format_InvalidEnumFormatSpecification);
  917            }
  919        }
  921        if (
type != underlyingType)
 
  922        {
  923            throw new ArgumentException(SR.Format(SR.Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType, 
type, underlyingType));
 
  924        }
  926        {
  928            {
  929            case 'G':
  930            case 'g':
  932            case 'D':
  933            case 'd':
  934                return value.ToString();
 
  935            case 'X':
  936            case 'x':
  938            case 'F':
  939            case 'f':
  941            }
  942        }
  943        throw new FormatException(SR.Format_InvalidEnumFormatSpecification);
  944    }
static Type GetUnderlyingType(Type enumType)
 
static string InternalFlagsFormat(RuntimeType enumType, ulong result)
 
static RuntimeType ValidateRuntimeType(Type enumType)
 
string ValueToHexString()
 
static string InternalFormat(RuntimeType enumType, ulong value)
 
 
References System.SR.Arg_EnumAndObjectMustBeSameType, System.SR.Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType, System.SR.Format(), System.format, System.SR.Format_InvalidEnumFormatSpecification, System.Type.GetType(), System.Enum.GetUnderlyingType(), System.Enum.InternalFlagsFormat(), System.Enum.InternalFormat(), System.Enum.ToUInt64(), System.type, System.Enum.ValidateRuntimeType(), System.value, and System.Enum.ValueToHexString().
Referenced by System.ComponentModel.EnumConverter.ConvertTo(), System.Xml.Serialization.SoapReflectionImporter.GetDefaultValue(), and System.Xml.Serialization.XmlReflectionImporter.GetDefaultValue().