Ejemplo n.º 1
0
 private void FillCustom(CustomElement custom, IExportElement data)
 {
     PropertyInfo[] props = data.GetType().GetProperties();
     foreach (PropertyInfo prop in props)
     {
         PropertyInfo prop1 = custom.GetType().GetProperty(prop.Name);
         if (prop1 != null)
         {
             prop.SetValue(data, prop1.GetValue(custom), null);
         }
     }
 }
Ejemplo n.º 2
0
 private void SetProperty(string propName, object value, CustomElement element)
 {
     try
     {
         PropertyInfo pro = element.GetType().GetProperty(propName);
         if (pro != null)
         {
             pro.SetValue(element, value, null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }