Example #1
0
 static ObjectAllocatorHolder()
 {
     if (_allocator == null)
     {
         _allocator = ObjectAllocators.GetAllocator(typeof(T));
     }
 }
Example #2
0
        public void SetTemplate(T template, IObjectAllocator <T> allocator)
        {
            Clear();
            if (_template != null)
            {
                _allocator.Destroy(_template);
            }

            _template  = template;
            _allocator = allocator;
            _allocator.SetTemplate(_template);
        }
 public virtual void Reset()
 {
     IsDisposed = false;
     _allocator = null;
 }
Example #4
0
 public ObjectContainer(IObjectAllocator <TContaining, TObject> allocator)
 {
     _allocator = allocator;
 }
Example #5
0
 public static void SetAllocator(Type type, IObjectAllocator allocator)
 {
     _allocatorDic[type] = allocator;
 }
Example #6
0
 public void SetAllocator(IObjectAllocator <T> allocator)
 {
     Clear();
     _allocator = allocator;
 }