private void loadAllCtors() { if (!_allCtor) { ConstructorInfo[] pi = CU.ExcelRegisteredCtors(ItemType); if (pi.GetLength(0) != _ctor.Count) { foreach (ConstructorInfo m in pi) { CacheItemCtor c = new CacheItemCtor(m); if (!_ctor.ContainsKey(c.ExcelName)) { _ctor.Add(c.ExcelName, c); } } } _allCtor = true; } }
private void loadAllProps() { if (!_allProp) { PropertyInfo[] pi = CU.ExcelRegisteredProperties(ItemType); if (pi.GetLength(0) != _prop.Count) { foreach (PropertyInfo m in pi) { CacheItemProperty c = new CacheItemProperty(m); if (!_prop.ContainsKey(c.ExcelName)) { _prop.Add(c.ExcelName, c); } } } _allProp = true; } }
private void loadAllMethods() { if (!_allMeth) { MethodInfo[] mi = CU.ExcelRegisteredMethods(ItemType); if (mi.GetLength(0) != _meth.Count) { foreach (MethodInfo m in mi) { CacheItemMethod c = new CacheItemMethod(m); if (!_meth.ContainsKey(c.ExcelName)) { _meth.Add(c.ExcelName, c); } } } _allMeth = true; } }
private CacheItemCtor extractCtor(string name) { CacheItemCtor c = null; if (!_ctor.ContainsKey(name)) { IEnumerable <ConstructorInfo> ci = CU.ExcelRegisteredCtors(ItemType) .Where(w => new CacheItemCtor(w).ExcelName == name); if (ci.Count() > 0) { c = new CacheItemCtor(ci.First()); _ctor.Add(name, c); } } else { c = _ctor[name]; } return(c); }
private CacheItemMethod extractCIM(string name) { CacheItemMethod m = null; if (!_meth.ContainsKey(name)) { IEnumerable <MethodInfo> mi = CU.ExcelRegisteredMethods(ItemType) .Where(w => new CacheItemMethod(w).ExcelName == name); if (mi.Count() > 0) { m = new CacheItemMethod(mi.First()); _meth.Add(name, m); } } else { m = _meth[name]; } return(m); }
// private #region extract property/method info private CacheItemProperty extractCIP(string name) { CacheItemProperty p = null; if (!_prop.ContainsKey(name)) { IEnumerable <PropertyInfo> pi = CU.ExcelRegisteredProperties(ItemType) .Where(w => new CacheItemProperty(w).ExcelName == name); if (pi.Count() > 0) { p = new CacheItemProperty(pi.First()); _prop.Add(name, p); } } else { p = _prop[name]; } return(p); }
public CacheItemProperty(PropertyInfo pi) { _pi = pi; _attr = CU.GetAttribute(_pi); }
public CacheItemMethod(MethodInfo mi) { _mi = mi; _attr = CU.GetAttribute(_mi); }
public CacheItemCtor(ConstructorInfo ci) { _ci = ci; _attr = CU.GetAttribute(_ci); }
public CacheType(Type t) { ItemType = t; _attr = CU.GetAttribute(ItemType); }