public object Provide(object key, DataProviderDelegate provider)
 {
     return Provide(key, provider, DefautlSlideTimeout, DefautlAbsoluteTimeout);
 }
        public object Provide(object key, DataProviderDelegate provider, TimeSpan SlideTimeout, TimeSpan AbsoluteTimeout)
        {
            CacheableObject co = null;
            lock (heap.SyncRoot)
                co = (CacheableObject)heap[key];

            if (co == null)
            {
                co = new CacheableObject();
                co.AbsoluteTimeout = AbsoluteTimeout;
                co.SlideTimeout = SlideTimeout;
                co.key = key;
                co.provider = provider;
                lock (heap.SyncRoot)
                    heap[key] = co;
            }
            return co.Data;
        }
Esempio n. 3
0
 public abstract void SetProvider(DataProviderDelegate del);
Esempio n. 4
0
 public override void SetProvider(DataProviderDelegate del)
 {
     mGet = del;
 }
Esempio n. 5
0
 public override void SetProvider(Equation <T> eq)
 {
     mGet = eq.GetValue;
 }
Esempio n. 6
0
 public ContinuousDataProvider(DataProviderDelegate del)
 {
     DataMethods.EnsureIsNumeric(typeof(T));
     SetProvider(del);
 }