Пример #1
0
 /// <summary>
 /// Index property for storing items in the resource pool
 /// </summary>
 public IDisposable this[object key]
 {
     get
     {
         if (Check(key))
         {
             return(_Pool.GetResource(key));
         }
         else
         {
             return(null);
         }
     }
     set
     {
         _Pool.SetResource(key, value);
     }
 }
Пример #2
0
 /// <summary>
 /// Gets resource from 2 level resource pool.
 /// </summary>
 /// <param name="container">Name of container resource pool</param>
 /// <param name="item">Name of the actual resource inside the container</param>
 /// <returns>The object requested</returns>
 public IDisposable Get(object container, object item)
 {
     if (_Pool.CheckResource(container))
     {
         ResourcePool containerPool = (ResourcePool)_Pool.GetResource(container);
         return(containerPool.GetResource(item));
     }
     else
     {
         return(null);
     }
 }