Example #1
0
        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;
            }
        }
Example #2
0
        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;
            }
        }
Example #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;
            }
        }
Example #4
0
        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);
        }
Example #5
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);
        }
Example #6
0
        // 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);
        }
Example #7
0
 public CacheItemProperty(PropertyInfo pi)
 {
     _pi   = pi;
     _attr = CU.GetAttribute(_pi);
 }
Example #8
0
 public CacheItemMethod(MethodInfo mi)
 {
     _mi   = mi;
     _attr = CU.GetAttribute(_mi);
 }
Example #9
0
 public CacheItemCtor(ConstructorInfo ci)
 {
     _ci   = ci;
     _attr = CU.GetAttribute(_ci);
 }
Example #10
0
 public CacheType(Type t)
 {
     ItemType = t;
     _attr    = CU.GetAttribute(ItemType);
 }