Castle.MicroKernel.Handlers.DefaultGenericHandler.EnsureClassMappingInitialized C# (CSharp) Method

EnsureClassMappingInitialized() private static method

private static EnsureClassMappingInitialized ( Type closedImplementationType, Type>.IDictionary &genericDefinitionToClass ) : void
closedImplementationType System.Type
genericDefinitionToClass Type>.IDictionary
return void
		private static void EnsureClassMappingInitialized(Type closedImplementationType, ref IDictionary<Type, Type> genericDefinitionToClass)
		{
			if (genericDefinitionToClass == null)
			{
				genericDefinitionToClass = new Dictionary<Type, Type>();
				var type = closedImplementationType;
				while (type != typeof(object))
				{
					if (type.IsGenericType)
					{
						genericDefinitionToClass.Add(type.GetGenericTypeDefinition(), type);
					}
					type = type.BaseType;
				}
			}
		}