Esempio n. 1
0
 protected void _Add(IRowEntry entry)
 {
     foreach (IValueWrapper <string> valueWrapper in entry.Cells)
     {
         ILazyUpdatable lazyUpdatable = valueWrapper as ILazyUpdatable;
         if (lazyUpdatable != null)
         {
             object source;
             if (this.Subscribed.TryGetValue(lazyUpdatable.GetSourceType(), out source))
             {
                 lazyUpdatable.Update(source);
             }
             Dictionary <Type, LinkedList <ILazyUpdatable> > lazyBindings = this.LazyBindings;
             lock (lazyBindings)
             {
                 this.LazyBindings.Append(lazyUpdatable.GetSourceType(), lazyUpdatable);
             }
         }
     }
 }
Esempio n. 2
0
        protected void _Remove(IRowEntry entry)
        {
            foreach (IValueWrapper <string> valueWrapper in entry.Cells)
            {
                ILazyUpdatable lazyUpdatable = valueWrapper as ILazyUpdatable;
                if (lazyUpdatable != null)
                {
                    Dictionary <Type, LinkedList <ILazyUpdatable> > lazyBindings = this.LazyBindings;
                    lock (lazyBindings)
                    {
                        this.LazyBindings[lazyUpdatable.GetSourceType()].Remove(lazyUpdatable);
                    }
                }
            }
            IDisposable disposable = entry as IDisposable;

            if (disposable != null)
            {
                disposable.Dispose();
            }
        }