Castle.MicroKernel.Tests.LoaderForDefaultImplementations.Load C# (CSharp) Method

Load() public method

public Load ( string name, Type service, IDictionary arguments ) : IRegistration
name string
service System.Type
arguments IDictionary
return IRegistration
		public IRegistration Load(string name, Type service, IDictionary arguments)
		{
			if (!Attribute.IsDefined(service, typeof(DefaultImplementationAttribute)))
			{
				return null;
			}

			var attributes = service.GetCustomAttributes(typeof(DefaultImplementationAttribute), false);
			var attribute = attributes[0] as DefaultImplementationAttribute;
			return Component.For(service).ImplementedBy(attribute.Implementation).Named(name);
		}
	}
LoaderForDefaultImplementations