/// <summary> /// </summary> /// <param name="propertyName"></param> /// <returns></returns> public NuGenPropertyInfo FindProperty(String propertyName) { if (String.IsNullOrEmpty(propertyName)) { return(null); } PropertyInfo propertyInfo = MemberFinder.FindProperty(_instance.GetType(), propertyName); if (propertyInfo != null) { return(new NuGenPropertyInfo(propertyInfo, _instance)); } return(null); }
/// <summary> /// Retrieves the property with the specified name. /// </summary> /// <param name="propertyName"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="propertyName"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="propertyName"/> is an empty string.</para> /// </exception> /// <exception cref="NuGenPropertyNotFoundException"/> public NuGenPropertyInfo this[String propertyName] { get { if (String.IsNullOrEmpty(propertyName)) { throw new ArgumentNullException("propertyName"); } PropertyInfo propertyInfo = MemberFinder.FindProperty(_instance.GetType(), propertyName); if (propertyInfo == null) { throw new NuGenPropertyNotFoundException(propertyName, _instance.GetType()); } return(new NuGenPropertyInfo(propertyInfo, _instance)); } }