public InputFieldDefinition Get(Type type, string propertyName) { var t = new PropertyInfoGetter() .GetPropertyInfo(type, propertyName) .PropertyType; if (typeToFieldTypes.ContainsKey(t)) return new InputFieldDefinition { Type = typeToFieldTypes[t] }; return null; }
private string[] GetPropNamesWithCustomAttrib(Type klass, PropertyInfoGetter getter) { string[] res; if (notIgnoredPropertieNames.TryGetValue(klass.GetType(), out res)) { return(res); } res = getter.GetNames(); return(res); }
private string GetHtmlAsAttribStringRef(string name, PropertyInfoGetter getter) { String htmlRef = ""; if (htmlAsProperties.TryGetValue(name, out htmlRef)) { return(htmlRef); } PropertyInfo p = getter.GetPropertyInfo(name); HtmlAsAttribute attribute = (HtmlAsAttribute)p.GetCustomAttribute(typeof(HtmlAsAttribute)); if (attribute != null) { htmlAsProperties.Add(name, attribute.htmlRef); return(attribute.htmlRef); } return(null); }
public void SetUp() { myModel = new MyModel(); firstNamePropertyInfo = myModel.GetType().GetProperty("FirstName"); propertyInfoGetter = new PropertyInfoGetter(); }