// // // // // $Revision$ // using System; using System.Collections.Generic; using Debugger.Wrappers.CorDebug; using Debugger.Wrappers.MetaData; namespace Debugger.MetaData { /// /// Provides information about a property in a class /// public class PropertyInfo: MemberInfo { MethodInfo getMethod; MethodInfo setMethod; /// Gets a value indicating whether this member has the private access modifier public override bool IsPrivate { get { return (getMethod ?? setMethod).IsPrivate; } } /// Gets a value indicating whether this member has the internal access modifier public override bool IsInternal { get { return (getMethod ?? setMethod).IsInternal; } } /// Gets a value indicating whether this member has the protected access modifier public override bool IsProtected { get { return (getMethod ?? setMethod).IsProtected; } } /// Gets a value indicating whether this member has the public access modifier public override bool IsPublic { get { return (getMethod ?? setMethod).IsPublic; } } /// Gets a value indicating whether this property is static public override bool IsStatic { get { return (getMethod ?? setMethod).IsStatic; } } /// Gets the metadata token associated with getter (or setter) /// of this property [Debugger.Tests.Ignore] public override uint MetadataToken { get { return (getMethod ?? setMethod).MetadataToken; } } /// Gets the name of this property public override string Name { get { return (getMethod ?? setMethod).Name.Remove(0,4); } } internal PropertyInfo(DebugType declaringType, MethodInfo getMethod, MethodInfo setMethod): base(declaringType) { if (getMethod == null && setMethod == null) throw new ArgumentNullException("Both getter and setter can not be null."); this.getMethod = getMethod; this.setMethod = setMethod; } /// Get the get accessor of the property public MethodInfo GetMethod { get { return getMethod; } } /// Get the set accessor of the property public MethodInfo SetMethod { get { return setMethod; } } } }