示例#1
0
        /// <summary>
        /// Get from cache
        /// </summary>
        /// <param name="name"></param>
        /// <param name="getValue"></param>
        /// <returns></returns>
        protected object GetFromCache(string name, GetValueHandler getValue)
        {
            object obj;

            if (_cache.TryGetValue(name, out obj))
            {
                return(obj);
            }

            if (getValue != null)
            {
                obj = getValue.Invoke();

                _cache[name] = obj;
            }

            return(obj);
        }
示例#2
0
 public virtual string GetValue(object row)
 {
     return(GetValueHandler?.Invoke(row) ?? (row as ExportDataRow)?.GetValue(ColumnName));
 }
示例#3
0
        /// <summary>
        /// Get from cache
        /// </summary>
        /// <param name="name"></param>
        /// <param name="getValue"></param>
        /// <returns></returns>
        protected object GetFromCache(string name, GetValueHandler getValue)
        {
            object obj;
            if (_cache.TryGetValue(name, out obj))
            {
                return obj;
            }

            if (getValue != null)
            {
                obj = getValue.Invoke();

                _cache[name] = obj;
            }

            return obj;
        }