public CacheItemMethod Method(string MethodName) { Exception = null; CacheItemMethod mi = extractCIM(MethodName); if (mi == null) { Exception = getE("Method", ExcelName, MethodName); } return(mi); }
public object Call(string Method, object[] o) { Exception = null; CacheItemMethod mi = _ct.Method(Method); object res = null; if (_ct.Exception == null) { res = mi.Call(Handle, o); Exception = mi.Exception; } else { Exception = _ct.Exception; } return(res); }
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 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); }
public override bool Equals(object obj) { CacheItemMethod m = obj as CacheItemMethod; return(this.ToString().Equals(m.ToString())); }