public Dictionary <int, Clazz> GetExcelToClazzMap(Dictionary <int, string> functionMap, string classForName) { functionMap.Add(-1, "objectid"); Dictionary <string, Clazz> methodMap = ReExcelUtils.MethodToLowerFunction(classForName); return(this.MapToMapKeyToValue(functionMap, methodMap)); }
public Dictionary <int, Clazz> GetExcelTitleToClazzMap(ISheet sheet, string mapFile, int titleIndex, string classForName) { Dictionary <string, int> titleList = this.getTitleList(sheet.GetRow(titleIndex)); Dictionary <int, Clazz> result; if (titleList == null) { result = null; } else { Dictionary <string, string> map = ExcelRead.ReadExcelToDic(mapFile, 0); Dictionary <int, string> functionMap = this.MapToMapKeyToValue(titleList, map); Dictionary <string, Clazz> methodMap = ReExcelUtils.MethodToLowerFunction(classForName); Dictionary <int, Clazz> dictionary = this.MapToMapKeyToValue(functionMap, methodMap); result = dictionary; } return(result); }
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); } } } } }
internal static Dictionary <string, Clazz> MethodToFunction <T>() { return(ReExcelUtils.MethodToFunction(typeof(T).ToString())); }
private Dictionary <string, Clazz> MethodToFunction(object obj) { return(ReExcelUtils.MethodToLowerFunction(obj.GetType().FullName)); }