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;
        }
예제 #2
0
            private string[] GetPropNamesWithCustomAttrib(Type klass, PropertyInfoGetter getter)
            {
                string[] res;
                if (notIgnoredPropertieNames.TryGetValue(klass.GetType(), out res))
                {
                    return(res);
                }

                res = getter.GetNames();

                return(res);
            }
예제 #3
0
            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();
 }
예제 #5
0
 public void SetUp()
 {
     myModel = new MyModel();
     firstNamePropertyInfo = myModel.GetType().GetProperty("FirstName");
     propertyInfoGetter    = new PropertyInfoGetter();
 }