src/Castle.Core/DynamicProxy/ModuleScope.cs
/// <summary>
///   Loads the generated types from the given assembly into this <see cref = "ModuleScope" />'s cache.
/// </summary>
/// <param name = "assembly">The assembly to load types from. This assembly must have been saved via <see
///    cref = "SaveAssembly(bool)" /> or
///   <see cref = "SaveAssembly()" />, or it must have the <see cref = "CacheMappingsAttribute" /> manually applied.</param>
/// <remarks>
///   This method can be used to load previously generated and persisted proxy types from disk into this scope's type cache, e.g. in order
///   to avoid the performance hit associated with proxy generation.
/// </remarks>
Loads the generated types from the given assembly into this 's cache.
Loads the generated types from the given assembly into this ' s cache .
public void LoadAssemblyIntoCache(Assembly assembly)
		{
			if (assembly == null)
			{
				throw new ArgumentNullException("assembly");
			}
			var cacheMappings =
				(CacheMappingsAttribute[])assembly.GetCustomAttributes(typeof(CacheMappingsAttribute), false);
			if (cacheMappings.Length == 0)
			{
				var message = string.Format(
					"The given assembly '{0}' does not contain any cache information for generated types.",
					assembly.FullName);
				throw new ArgumentException(message, "assembly");
			}
			foreach (var mapping in cacheMappings[0].GetDeserializedMappings())
			{
				var loadedType = assembly.GetType(mapping.Value);
				if (loadedType != null)
				{
					typeCache.AddOrUpdateWithoutTakingLock(mapping.Key, loadedType);
				}
			}
		}
public void LoadAssemblyIntoCache ( Assembly assembly ) { if ( assembly == null ) { throw new ArgumentNullException ( " " ) ; } var cacheMappings = ( CacheMappingsAttribute [ ] ) assembly . GetCustomAttributes ( typeof ( CacheMappingsAttribute ) , false ) ; if ( cacheMappings . Length == 0 ) { var message = string . Format ( " " , assembly . FullName ) ; throw new ArgumentException ( message , " " ) ; } foreach ( var mapping in cacheMappings [ 0 ] . GetDeserializedMappings ( ) ) { var loadedType = assembly . GetType ( mapping . Value ) ; if ( loadedType != null ) { typeCache . AddOrUpdateWithoutTakingLock ( mapping . Key , loadedType ) ; } } }
Loads the generated types from the given assembly into this 's cache.
Loads the generated types from the given assembly into this ' s cache .
assembly
Assembly
The assembly to load types from. This assembly must have been saved via  or
, or it must have the  manually applied.
The assembly to load types from . This assembly must have been saved via or or it must have the manually applied .
remarks
This method can be used to load previously generated and persisted proxy types from disk into this scope's type cache, e.g. in order
to avoid the performance hit associated with proxy generation.
This method can be used to load previously generated and persisted proxy types from disk into this scope ' s type cache e . g . in order to avoid the performance hit associated with proxy generation .