示例#1
0
 /// <summary>
 /// Frees the resources used by instances of this class.
 /// </summary>
 public new void Dispose()
 {
     DisposableSingletonManager.Dereference <T>();
 }
示例#2
0
 /// <summary>
 /// Gets the singleton instance of the specified class type that is managed
 /// by <see cref="DisposableSingletonManager"/>. If no instance exists, then
 /// one is created using the type's parameterless contructor.
 /// This method also increments the singleton instance's reference count so that
 /// the instance's <see cref="IDisposable.Dispose"/> method is not called when there
 /// are multiple references to the instance in existence.
 /// </summary>
 /// <returns>Returns the singleton instance of the specified type.</returns>
 public static T GetInstance()
 {
     return(DisposableSingletonManager.GetInstance <T>());
 }