This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Can_specify_multiple_subscribers() | |
{ | |
container.Register( | |
Component.For<SimplePublisher>() | |
.PublishEvent(p => p.Event += null, | |
x => x.To("foo") | |
.To<SimpleListener>("bar", l => l.OnPublish(null, null))), | |
Component.For<ListenerWithOnEventMethod>().Named("foo"), | |
Component.For<SimpleListener>().Named("bar")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Single_publisher_single_subscriber_single_event() | |
{ | |
container.Register( | |
Component.For<SimplePublisher>() | |
.PublishEvent(p => p.Event += null) | |
.ToSubscribers( | |
EventSubscriber | |
.Named("foo") | |
.HandledBy<SimpleListener>(l => l.OnPublish(null, null))), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Can_fluently_wire_events() | |
{ | |
container.Register(Component.For<SimplePublisher>().PublishEvent("Event", "myUniqueEventId"), | |
Component.For<SimpleListener>().SubscribeEvent("myUniqueEventId", "OnEvent")); | |
var publisher = container.Resolve<SimplePublisher>(); | |
var listener = container.Resolve<SimpleListener>(); | |
Assert.IsFalse(listener.Listened); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (ComponentType.IsGenericType)// we support generic collections only | |
{ | |
// TypeUtil.GetAllInterfaces resturns flat collection of all interfaces, regardless of level | |
foreach (var @interface in TypeUtil.GetAllInterfaces(ComponentType)) | |
{ | |
if(@interface.GetGenericTypeDefinition()==typeof(IEnumerable<>)) | |
{ | |
return @interface.GetGenericArguments().Single(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2004-2010 Castle Project - http://www.castleproject.org/ | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Castle.Windsor/Installer/ConfigurationInstaller.cs b/src/Castle.Windsor/Installer/ConfigurationInstaller.cs | |
index 8ac2004..9e5356a 100644 | |
--- a/src/Castle.Windsor/Installer/ConfigurationInstaller.cs | |
+++ b/src/Castle.Windsor/Installer/ConfigurationInstaller.cs | |
@@ -1,75 +1,75 @@ | |
-// Copyright 2004-2009 Castle Project - http://www.castleproject.org/ | |
-// | |
-// Licensed under the Apache License, Version 2.0 (the "License"); | |
-// you may not use this file except in compliance with the License. | |
-// You may obtain a copy of the License at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ConcreteLoader : ILazyComponentLoader | |
{ | |
public IRegistration Load(string key, Type service) | |
{ | |
// to make sure it really is concrete type | |
if (!(service.IsClass&&service.IsAbstract==false)) | |
{ | |
return null; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void ResolveAllAccountsForAssignableServices() | |
{ | |
kernel.AddComponent("test", typeof(ICommon), typeof(CommonImpl2)); | |
kernel.AddComponent("test2", typeof(ICommonSub1), typeof(CommonSub1Impl)); | |
kernel.AddComponent("test3", typeof(ICommonSub1), typeof(CommonSub1Impl)); | |
ICommon[] services = kernel.ResolveAll<ICommon>(); | |
Assert.AreEqual(3, services.Length); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Castle.DynamicProxy.IAttributeDisassembler |0 | | |
Castle.Core.Interceptor.IChangeProxyTarget |1 | | |
Castle.Core.Interceptor.IInterceptor |1 | | |
Castle.Core.Interceptor.IInterceptorSelector |1 | | |
Castle.Core.Interceptor.IInvocation |1 | | |
Castle.Core.Interceptor.IProxyTargetAccessor |1 | | |
Castle.Core.Interceptor.StandardInterceptor |1 | | |
Castle.Core.Internal.ILockHolder |1 | | |
Castle.Core.Internal.IUpgradeableLockHolder |1 | | |
Castle.Core.Internal.Lock |1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT benchmarkr0_.User as User2_, | |
benchmarkr0_.Id as Id2_, | |
benchmarkr0_.Id as Id0_1_, | |
benchmarkr0_.BenmchmarkName as Benmchma2_0_1_, | |
benchmarkr0_.ComputerModel as Computer3_0_1_, | |
benchmarkr0_.Score as Score0_1_, | |
benchmarkr0_.[User] as User5_0_1_, | |
user1_.Id as Id1_0_, | |
user1_.Name as Name1_0_, | |
user1_.Email as Email1_0_, |