Esempio n. 1
0
 public virtual object GetProperty(object o, string field)
 {
     Net.Vpc.Upa.Impl.Util.BeanAdapterAttribute attrAdapter = GetAttrAdapter(field);
     if (attrAdapter != null)
     {
         return(attrAdapter.GetValue(o));
     }
     return(null);
 }
Esempio n. 2
0
 public virtual System.Collections.Generic.IDictionary <string, object> ToMap(object o, bool?includeDefaults)  /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     System.Collections.Generic.Dictionary <string, object> map = new System.Collections.Generic.Dictionary <string, object>();
     if (includeDefaults == null)
     {
         foreach (string k in GetPropertyNames())
         {
             Net.Vpc.Upa.Impl.Util.BeanAdapterAttribute e = GetAttrAdapter(k);
             map[k] = e.GetValue(o);
         }
     }
     else
     {
         foreach (string k in GetPropertyNames())
         {
             Net.Vpc.Upa.Impl.Util.BeanAdapterAttribute e = GetAttrAdapter(k);
             if (includeDefaults == e.IsDefaultValue(o))
             {
                 map[k] = e.GetValue(o);
             }
         }
     }
     return(map);
 }