Ejemplo n.º 1
0
 private static void _AddFieldParams(object obj, StringDictionary dict,
                                     IEnumerable <Type> knownTypes)
 {
     FieldInfo[] info = obj.GetType().GetFields();
     foreach (FieldInfo fi in info)
     {
         QueryParameterAttribute queryAttr = null;
         if (_FindCustomAttr(fi.GetCustomAttributes(false), out queryAttr))
         {
             dict.Add(queryAttr.Name,
                      _ParamValueToString(fi.GetValue(obj), knownTypes));
         }
     }
 }
Ejemplo n.º 2
0
 private static void _AddPropertyParams(object obj, StringDictionary dict,
                                        IEnumerable <Type> knownTypes)
 {
     PropertyInfo[] propInfo = obj.GetType().GetProperties();
     foreach (PropertyInfo pi in propInfo)
     {
         QueryParameterAttribute queryAttr = null;
         if (_FindCustomAttr(pi.GetCustomAttributes(false), out queryAttr))
         {
             dict.Add(queryAttr.Name,
                      _ParamValueToString(pi.GetValue(obj, null), knownTypes));
         }
     }
 }