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 interface IServiceHostBuilder | |
{ | |
ServiceHostModel Build(); | |
} | |
public abstract class ServiceModelBuilder<TService> :IServiceHostBuilder | |
{ | |
// goo | |
} |
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 Dictionary_enumerates_from_oldest_to_latest() | |
{ | |
var expected1 = new[] { 1, 2, 4, 3 }; | |
var dictionary1 = new Dictionary<int, object>(); | |
foreach (var key in expected1) | |
{ | |
dictionary1[key] = new object(); | |
} |
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 Foo | |
{ | |
public Foo() {} //1 | |
public Foo(string foo = null) {} //2 | |
} | |
public class Bar | |
{ | |
public Bar() {} //3 |
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 DataAccessInstaller:IWindsorInstaller | |
{ | |
public void Install(IWindsorContainer container, IConfigurationStore store) | |
{ | |
container.Kernel.ComponentModelBuilder.AddContributor(new SubmitChangesDataContextContributor()); | |
container.Register(Component.For<DataDataContext>() | |
.LifeStyle.PerWebRequest | |
// some other components | |
); | |
} |
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
Starting Test Run: 4/07/2010 8:44:43 AM | |
A Silverlight MessageBox dialog was automatically closed. | |
Caption: Unhandled Error in Silverlight Application | |
Super Secret StatLight Code: 836D4425-DB59-48BB-BA7B-03AB20A57499 | |
Code: 4004 | |
Category: ManagedRuntimeError | |
Message: System.IO.FileNotFoundException: Could not load file or assembly 'NUnit.Silverlight.Compatibility, Version=2010.6.1. | |
0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The system cannot find the file specified. |
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
var container = new WindsorContainer(); | |
container.AddFacility<NHibernateFacility>(c => c.ForMsSql2005().ConnectionStringName("myConnectionString")))); |
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 interface IReference<out T> {} | |
public class ComponentReference<T> : IReference<T> {} | |
// somewhere | |
public static IReference<IInterceptor> ForType<T>() where T:IInterceptor | |
{ | |
// this won't compile | |
return new ComponentReference<T>(); | |
} |
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
namespace Castle.Windsor.Tests | |
{ | |
using System; | |
using System.Collections.Generic; | |
using Castle.Core; | |
using Castle.MicroKernel; | |
using Castle.MicroKernel.ComponentActivator; | |
using Castle.MicroKernel.Registration; | |
using Castle.MicroKernel.Resolvers; | |
using Castle.MicroKernel.Tests.ClassComponents; |
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
/// <summary> | |
/// Helper class used by <see cref="FromAssembly"/> to filter/order and instantiate <see cref="IWindsorInstaller"/> implementations | |
/// </summary> | |
public class InstallerFactory | |
{ | |
/// <summary> | |
/// Performs custom filtering/ordering of given set of types. | |
/// </summary> | |
/// <param name="installerTypes">Set of concrete class types implementing <see cref="IWindsorInstaller"/> interface.</param> | |
/// <returns>Transformed <paramref name="installerTypes"/>.</returns> |
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) | |
.ToSubscribers( | |
EventSubscriber.Named("foo"), | |
EventSubscriber | |
.Named("bar") |