SmartDIContainer.cs
/// <summary>
/// If the type exists as a shared instance, removes it. Only used if this shared instance is about to go out of view.
/// </summary>
/// <typeparam name="ObjectT">The type of the object t.</typeparam>
/// <param name="obj">The object.</param>
If the type exists as a shared instance, removes it. Only used if this shared instance is about to go out of view.
If the type exists as a shared instance removes it . Only used if this shared instance is about to go out of view .
protected void RemoveSharedInstance<ObjectT>(ObjectT obj)
      {
         var foundSharedInstance =
            _sharedInstancesWithBoundMembers.FirstOrDefault(si => ReferenceEquals(si.Key, obj));
         if (foundSharedInstance.IsNotAnEqualObjectTo(default(KeyValuePair<object, List<object>>)))
         {
            _sharedInstancesWithBoundMembers.Remove(foundSharedInstance.Key);
         }
      }
protected void RemoveSharedInstance < ObjectT > ( ObjectT obj ) { var foundSharedInstance = _sharedInstancesWithBoundMembers . FirstOrDefault ( si => ReferenceEquals ( si . Key , obj ) ) ; if ( foundSharedInstance . IsNotAnEqualObjectTo ( default ( KeyValuePair < object , List < object > > ) ) ) { _sharedInstancesWithBoundMembers . Remove ( foundSharedInstance . Key ) ; } }
If the type exists as a shared instance, removes it.
If the type exists as a shared instance removes it .
// Seek these by reference, since we have a valid object. It's safer considering that any instantiated type can // be returned as any implemented interface. So the type could easily mis-match.
obj
ObjectT
None
typeparam
The type of the object t.
The type of the object t .