namespace System.Reflection
{
-#if NET_4_0
+ abstract class RuntimeParameterInfo : ParameterInfo
+ {
+
+ }
+
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_ParameterInfo))]
[Serializable]
[ClassInterfaceAttribute (ClassInterfaceType.None)]
[StructLayout (LayoutKind.Sequential)]
- class MonoParameterInfo : ParameterInfo {
-#else
- public partial class ParameterInfo {
-#endif
+ class MonoParameterInfo : RuntimeParameterInfo {
#if !FULL_AOT_RUNTIME
-#if NET_4_0
internal MonoParameterInfo (ParameterBuilder pb, Type type, MemberInfo member, int position) {
-#else
- internal ParameterInfo (ParameterBuilder pb, Type type, MemberInfo member, int position) {
-#endif
this.ClassImpl = type;
this.MemberImpl = member;
if (pb != null) {
#endif
/*FIXME this constructor looks very broken in the position parameter*/
-#if NET_4_0
internal MonoParameterInfo (ParameterInfo pinfo, Type type, MemberInfo member, int position) {
-#else
- internal ParameterInfo (ParameterInfo pinfo, Type type, MemberInfo member, int position) {
-#endif
this.ClassImpl = type;
this.MemberImpl = member;
if (pinfo != null) {
}
}
-#if NET_4_0
internal MonoParameterInfo (ParameterInfo pinfo, MemberInfo member) {
-#else
- internal ParameterInfo (ParameterInfo pinfo, MemberInfo member) {
-#endif
this.ClassImpl = pinfo.ParameterType;
this.MemberImpl = member;
this.NameImpl = pinfo.Name;
}
/* to build a ParameterInfo for the return type of a method */
-#if NET_4_0
internal MonoParameterInfo (Type type, MemberInfo member, MarshalAsAttribute marshalAs) {
-#else
- internal ParameterInfo (Type type, MemberInfo member, MarshalAsAttribute marshalAs) {
-#endif
this.ClassImpl = type;
this.MemberImpl = member;
this.NameImpl = "";
this.marshalAs = marshalAs;
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
object DefaultValue {
get {
if (ClassImpl == typeof (Decimal)) {
/* default values for DateTime are encoded using a custom attribute */
DateTimeConstantAttribute[] attrs = (DateTimeConstantAttribute[])GetCustomAttributes (typeof (DateTimeConstantAttribute), false);
if (attrs.Length > 0)
- return new DateTime (attrs [0].Ticks);
+ return attrs [0].Value;
}
return DefaultValueImpl;
}
}
-#if NET_4_0
public override
-#else
- public
-#endif
object RawDefaultValue {
get {
/*FIXME right now DefaultValue doesn't throw for reflection-only assemblies. Change this once the former is fixed.*/
}
public
-#if NET_4_0
override
-#endif
int MetadataToken {
get {
if (MemberImpl is PropertyInfo) {
public
-#if NET_4_0
override
-#else
- virtual
-#endif
object[] GetCustomAttributes (bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, inherit);
}
public
-#if NET_4_0
override
-#else
- virtual
-#endif
object[] GetCustomAttributes (Type attributeType, bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
public
-#if NET_4_0
override
-#else
- virtual
-#endif
bool IsDefined( Type attributeType, bool inherit) {
return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
public
-#if NET_4_0
override
-#else
- virtual
-#endif
Type[] GetOptionalCustomModifiers () {
Type[] types = GetTypeModifiers (true);
if (types == null)
}
public
-#if NET_4_0
override
-#else
- virtual
-#endif
Type[] GetRequiredCustomModifiers () {
Type[] types = GetTypeModifiers (false);
if (types == null)
return types;
}
-#if NET_4_5
public override bool HasDefaultValue {
get {
object defaultValue = DefaultValue;
return true;
}
}
-#endif
}
}