| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- // System.Reflection.ParameterInfo
- //
- // Sean MacIsaac ([email protected])
- //
- // (C) 2001 Ximian, Inc.
- using System.Reflection.Emit;
- namespace System.Reflection
- {
- [Serializable]
- public class ParameterInfo : ICustomAttributeProvider
- {
- protected Type ClassImpl;
- protected object DefaultValueImpl;
- protected MemberInfo MemberImpl;
- protected string NameImpl;
- protected int PositionImpl;
- protected ParameterAttributes AttrsImpl;
- protected ParameterInfo () {
- }
- internal ParameterInfo (ParameterBuilder pb, Type type, MemberInfo member) {
- this.ClassImpl = type;
- this.MemberImpl = member;
- this.NameImpl = pb.Name;
- this.PositionImpl = pb.Position;
- this.AttrsImpl = (ParameterAttributes) pb.Attributes;
- }
-
- /* to build a ParameterInfo for the return type of a method */
- internal ParameterInfo (Type type, MemberInfo member) {
- this.ClassImpl = type;
- this.MemberImpl = member;
- this.NameImpl = "";
- this.PositionImpl = 0;
- this.AttrsImpl = ParameterAttributes.Retval;
- }
-
- public virtual Type ParameterType {
- get {return ClassImpl;}
- }
- public virtual ParameterAttributes Attributes {
- get {return AttrsImpl;}
- }
- public virtual object DefaultValue {
- get {return DefaultValueImpl;}
- }
- public bool IsIn {
- get {return (AttrsImpl & ParameterAttributes.In) != 0;}
- }
- public bool IsLcid {
- get {return (AttrsImpl & ParameterAttributes.Lcid) != 0;}
- }
- public bool IsOptional {
- get {return (AttrsImpl & ParameterAttributes.Optional) != 0;}
- }
- public bool IsOut {
- get {return (AttrsImpl & ParameterAttributes.Out) != 0;}
- }
- public bool IsRetval {
- get {return (AttrsImpl & ParameterAttributes.Retval) != 0;}
- }
- public virtual MemberInfo Member {
- get {return MemberImpl;}
- }
- public virtual string Name {
- get {return NameImpl;}
- }
- public virtual int Position {
- get {return PositionImpl;}
- }
- public virtual object[] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public virtual object[] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
- public virtual bool IsDefined( Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
- }
- }
|