System.Web.UI.WebControls.ImageField.GetProperty C# (CSharp) Method

GetProperty() private method

private GetProperty ( Control controlContainer, string fieldName ) : PropertyDescriptor
controlContainer System.Web.UI.Control
fieldName string
return System.ComponentModel.PropertyDescriptor
		PropertyDescriptor GetProperty (Control controlContainer, string fieldName)
		{
			if (fieldName == ThisExpression)
				return null;
			
			IDataItemContainer dic = (IDataItemContainer) controlContainer;
			PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (dic.DataItem);
			PropertyDescriptor prop = properties != null ? properties [fieldName] : null;
			if (prop == null)
				throw new InvalidOperationException ("Property '" + fieldName + "' not found in object of type " + dic.DataItem.GetType());
			
			return prop;
		}