public sealed override Object GetConstantValue() { #if ENABLE_REFLECTION_TRACE if (ReflectionTrace.Enabled) { ReflectionTrace.PropertyInfo_GetConstantValue(this); } #endif if (!(_definingTypeInfo.ReflectionDomain is ExecutionDomain)) { throw new NotSupportedException(); // Cannot instantiate a boxed enum on a non-execution domain. } Object defaultValue; if (!ReflectionCoreExecution.ExecutionEnvironment.GetDefaultValueIfAny( _reader, _propertyHandle, this.PropertyType, this.CustomAttributes, out defaultValue)) { throw new InvalidOperationException(); } return(defaultValue); }
public sealed override Object GetConstantValue() { #if ENABLE_REFLECTION_TRACE if (ReflectionTrace.Enabled) { ReflectionTrace.PropertyInfo_GetConstantValue(this); } #endif Object defaultValue; if (!DefaultValueProcessing.GetDefaultValueIfAny(_reader, ref _property, this, out defaultValue)) { throw new InvalidOperationException(); } return(defaultValue); }
private object GetConstantValue(bool raw) { #if ENABLE_REFLECTION_TRACE if (ReflectionTrace.Enabled) { ReflectionTrace.PropertyInfo_GetConstantValue(this); } #endif object defaultValue; if (!GetDefaultValueIfAny(raw, out defaultValue)) { throw new InvalidOperationException(SR.Arg_EnumLitValueNotFound); } return(defaultValue); }
public sealed override Object GetConstantValue() { #if ENABLE_REFLECTION_TRACE if (ReflectionTrace.Enabled) { ReflectionTrace.PropertyInfo_GetConstantValue(this); } #endif Object defaultValue; if (!ReflectionCoreExecution.ExecutionEnvironment.GetDefaultValueIfAny( _reader, _propertyHandle, this.PropertyType, this.CustomAttributes, out defaultValue)) { throw new InvalidOperationException(); } return(defaultValue); }