SmartDIContainer.cs
/// <summary>
/// Attempts to resolve conlicts, if they exist.
/// </summary>
/// <param name="conflictResolver">The conflict resolver.</param>
/// <param name="qualifyingRegistrations">The qualifying registrations.</param>
/// <param name="qualifyingMasterType">Type of the qualifying master.</param>
/// <param name="resolutionToSeek">The resolution to seek.</param>
/// <returns><c>true</c> if all conflicts have been resolved, else <c>false</c>.</returns>
Attempts to resolve conlicts, if they exist.
Attempts to resolve conlicts if they exist .
private bool CannotResolveConflicts
      (
         Func<ConcurrentDictionary<Type, ITimeStampedCreatorAndStorageRules>, IConflictResolution> conflictResolver,
         ConcurrentDictionary<Type, ITimeStampedCreatorAndStorageRules>
            qualifyingRegistrations,
         ref Type                                              qualifyingMasterType,
         ref KeyValuePair<Type, IProvideCreatorAndStorageRule> resolutionToSeek
      )
      {
         if ((qualifyingRegistrations.Count > 1) && (conflictResolver != null))
         {
            var masterResolution = conflictResolver(qualifyingRegistrations);
            if (masterResolution != null)
            {
               qualifyingMasterType = masterResolution.MasterType;
               resolutionToSeek     = masterResolution.TypeToCastWithStorageRule;
            }
            if ((masterResolution == null)
              ||
                qualifyingMasterType.IsNotAnEqualObjectTo(default(Type))
              ||
                resolutionToSeek.IsAnEqualObjectTo(default(KeyValuePair<Type, IProvideCreatorAndStorageRule>))
            )
            {
               return true;
            }
         }
         return false;
      }
private bool CannotResolveConflicts ( Func < ConcurrentDictionary < Type , ITimeStampedCreatorAndStorageRules > , IConflictResolution > conflictResolver , ConcurrentDictionary < Type , ITimeStampedCreatorAndStorageRules > qualifyingRegistrations , ref Type qualifyingMasterType , ref KeyValuePair < Type , IProvideCreatorAndStorageRule > resolutionToSeek ) { if ( ( qualifyingRegistrations . Count > 1 ) && ( conflictResolver != null ) ) { var masterResolution = conflictResolver ( qualifyingRegistrations ) ; if ( masterResolution != null ) { qualifyingMasterType = masterResolution . MasterType ; resolutionToSeek = masterResolution . TypeToCastWithStorageRule ; } if ( ( masterResolution == null ) || qualifyingMasterType . IsNotAnEqualObjectTo ( default ( Type ) ) || resolutionToSeek . IsAnEqualObjectTo ( default ( KeyValuePair < Type , IProvideCreatorAndStorageRule > ) ) ) { return true ; } } return false ; }
Attempts to resolve conlicts, if they exist.
Attempts to resolve conlicts if they exist .
None
conflictResolver
Func<ConcurrentDictionary<Type, ITimeStampedCreatorAndStorageRules>, IConflictResolution>
The conflict resolver.
The conflict resolver .
qualifyingRegistrations
ConcurrentDictionary<Type, ITimeStampedCreatorAndStorageRules>
The qualifying registrations.
The qualifying registrations .
Type
ref
KeyValuePair<Type, IProvideCreatorAndStorageRule>
ref
qualifyingMasterType
Type of the qualifying master.
Type of the qualifying master .
resolutionToSeek
The resolution to seek.
The resolution to seek .