Esempio n. 1
0
        public CacheItemMethod Method(string MethodName)
        {
            Exception = null;

            CacheItemMethod mi = extractCIM(MethodName);

            if (mi == null)
            {
                Exception = getE("Method", ExcelName, MethodName);
            }

            return(mi);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        public override bool Equals(object obj)
        {
            CacheItemMethod m = obj as CacheItemMethod;

            return(this.ToString().Equals(m.ToString()));
        }