/// <summary> /// Releases pool item by instance /// </summary> /// <returns></returns> public void ReleaseInstance(object instance) { PoolServiceDescriptor descriptor; lock (Descriptors) descriptor = Descriptors.Find(x => x.Instance == instance); if (descriptor != null) { Release(descriptor); } }
/// <summary> /// Return true if this simulation has a descriptor. /// </summary> /// <param name="descriptor">The descriptor to search for.</param> public bool HasDescriptor(Descriptor descriptor) { return(Descriptors.Find(d => d.Name == descriptor.Name && d.Value == descriptor.Value) != null); }