コード例 #1
0
 public static T Get <T>(IResource res, ResourceTypeId <T> resourceTypeId) where T : BusinessObject
 {
     lock (_cache)
     {
         WeakReference reference;
         if (_cache.TryGetValue(res.Id, out reference))
         {
             object target = reference.Target;
             if (target != null)
             {
                 return((T)target);
             }
         }
         T result = resourceTypeId.CreateBusinessObject(res);
         _cache[res.Id] = new WeakReference(result);
         return(result);
     }
 }
コード例 #2
0
 public BusinessObjectEnumerator(ResourceTypeId <T> resourceType, IEnumerator idEnumerator)
 {
     _resourceType       = resourceType;
     _resourceEnumerator = idEnumerator;
 }
コード例 #3
0
 public BusinessObjectList(ResourceTypeId <T> resourceTypeId, IResourceList baseList)
 {
     _resourceTypeId = resourceTypeId;
     _baseList       = baseList;
 }