Beispiel #1
0
 public static void ClassCopy(object srcObj, object descObj)
 {
     if (srcObj != null)
     {
         Dictionary <string, Clazz> dictionary  = ReExcelUtils.MethodToFunction(srcObj.GetType().ToString());
         Dictionary <string, Clazz> dictionary2 = ReExcelUtils.MethodToFunction(descObj.GetType().ToString());
         object[] array = new object[1];
         foreach (string current in dictionary.Keys)
         {
             Clazz clazz;
             if (dictionary2.TryGetValue(current, out clazz))
             {
                 MethodInfo getMethodInfo = dictionary[current].GetMethodInfo;
                 if (getMethodInfo != null)
                 {
                     array[0] = getMethodInfo.Invoke(srcObj, null);
                     clazz.SetMethodInfo.Invoke(descObj, array);
                 }
             }
         }
     }
 }
Beispiel #2
0
 internal static Dictionary <string, Clazz> MethodToFunction <T>()
 {
     return(ReExcelUtils.MethodToFunction(typeof(T).ToString()));
 }