Microsoft.JScript.TypeReferences.GetConstantValue C# (CSharp) Метод

GetConstantValue() статический приватный Метод

static private GetConstantValue ( FieldInfo field ) : Object
field System.Reflection.FieldInfo
Результат Object
    internal static Object GetConstantValue(FieldInfo field) {
      if (field.GetType().Assembly == typeof(TypeReferences).Assembly ||
          !field.DeclaringType.Assembly.ReflectionOnly)
        return field.GetValue(null);
      
      Type type = field.FieldType;
      Object value = field.GetRawConstantValue();
      if (type.IsEnum)
        return MetadataEnumValue.GetEnumValue(type, value);
      return value;
    }
  }