public object Get(string Property) { Exception = null; CacheItemProperty pi = _ct.Property(Property); object res = null; if (_ct.Exception == null) { res = pi.Get(Handle, null); if (pi.Exception == null) { if (res.GetType().IsArray) { object[,] p = null; ParameterCleaner.Build2DOutput(string.Empty, res, out p); res = p; } } else { Exception = pi.Exception; } } else { Exception = _ct.Exception; } return(res); }
public CacheItemProperty Property(string PropertyName) { Exception = null; CacheItemProperty pi = extractCIP(PropertyName); if (pi == null) { Exception = getE("Property", ExcelName, PropertyName); } return(pi); }
public void Set(string Property, object o) { Exception = null; CacheItemProperty pi = _ct.Property(Property); if (_ct.Exception == null) { pi.Set(Handle, o, null); Exception = pi.Exception; } else { Exception = _ct.Exception; } }
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 #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 override bool Equals(object obj) { CacheItemProperty m = obj as CacheItemProperty; return(this.ToString().Equals(m.ToString())); }