void OnRegistered( object sender, ComponentRegisteredEventArgs e )
		{
			var services = e.ComponentRegistration.Services
				.OfType<TypedService>()
				.Select( t => t.ServiceType )
				.ToArray();
			
			var implementation = e.ComponentRegistration.Activator.LimitType;

			var bag = new Bag() 
			{
				Services = services,
				Implementation = implementation
			};

			if ( this.IsInterestingHandler( bag, typeof( IMessageHandler ) ) || this.IsInterestingHandler( bag, typeof( IHandleMessage ) ) )
			{
				logger.Debug
				(
					"Registered component is IMessageHandler/IHandleMessage: {0}/{1}, but no broker yet registered. buffering...",
					services.FirstOrDefault() == null ? "<null>" : services.FirstOrDefault().ToString( "SN" ),
					implementation.ToString( "SN" )
				);

				this.buffer.Add( new Tuple<Guid, Bag>( e.ComponentRegistration.Id, bag ) );
			}
		}
 public void ConstructorSetsProperties()
 {
     var registry = new ComponentRegistry();
     var registration = Factory.CreateSingletonObjectRegistration();
     var args = new ComponentRegisteredEventArgs(registry, registration);
     Assert.Same(registry, args.ComponentRegistry);
     Assert.Same(registration, args.ComponentRegistration);
 }
		void OnRegistered( object sender, ComponentRegisteredEventArgs e )
		{
			var typeTo = e.ComponentRegistration.Activator.LimitType;
			var regionName = this.conventions.GetInterestedRegionNameIfAny( typeTo );
			if ( !String.IsNullOrWhiteSpace( regionName ) )
			{
				var viewType = typeTo;

				if ( this.buffer.ContainsKey( regionName ) )
				{
					this.buffer[ regionName ].Add( viewType );
				}
				else
				{
					this.buffer.Add( regionName, new List<Type>() { viewType } );
				}
			}
		}
 public void NullRegistrationDetected()
 {
     var registry = new ComponentRegistry();
     var args = new ComponentRegisteredEventArgs(registry, null);
 }
 public void NullContainerDetected()
 {
     var registration = Factory.CreateSingletonObjectRegistration();
     var args = new ComponentRegisteredEventArgs(null, registration);
 }
 private void ComponentRegistry_Registered(object sender, ComponentRegisteredEventArgs e)
 {
     e.ComponentRegistration.Preparing += ComponentRegistration_Preparing;
 }