public IResource GetResource(string url, bool allowShare, ref List <ISharableResource> checkedOutList, out IResource[] unhandledDependants, out IResource[] unhandledDependancies) { // TODO: break-up url here Uri uri = new Uri(url); if (uri.IsFile) { // look for existing ISharableResource sRz = resourceSet.Checkout(url); if (sRz != null) { if (sRz.Value is IResource) { checkedOutList.Add(sRz); unhandledDependants = null; unhandledDependancies = null; return((IResource)sRz.Value); } // throw away resourceSet.Checkin(sRz); } // load up from fresh IResource[] dependants, dependancies; string realRzId; IResource rz = cdi.ResourceLoader.LoadResource(uri, this, out dependants, out dependancies, out realRzId); // share if allowed if (allowShare && rz != null) { resourceSet.Checkin(rz, realRzId, out sRz); checkedOutList.Add(sRz); // deal with dependants & dependancies if (dependants != null) { foreach (IResource item in dependants) { resourceSet.Checkin(item, item.Id, out sRz); checkedOutList.Add(sRz); } } if (dependancies != null) { foreach (IResource item in dependancies) { resourceSet.Checkin(item, item.Id, out sRz); checkedOutList.Add(sRz); } } unhandledDependants = null; unhandledDependancies = null; } else { unhandledDependants = dependants; unhandledDependancies = dependancies; } // double check we have right rz if (realRzId != null) { rz = (IResource)resourceSet.PeekRz(url).Value; } return(rz); } unhandledDependants = null; unhandledDependancies = null; return(null); }