Skip to content

Instantly share code, notes, and snippets.

@DavidSSL
Created April 10, 2013 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidSSL/5355558 to your computer and use it in GitHub Desktop.
Save DavidSSL/5355558 to your computer and use it in GitHub Desktop.
public static void Main()
{
// 1. Instantiate the IWindsor container object
var container = new WindsorContainer();
// 2. Register the services and the respective components that implement them
container.Register(Types
.FromAssemblyContaining<HttpFileDownloader>
.BasedOn<IHtmlTitleRetriever>());
);
// 3. "Resolve" the root service
var retriever = container.Resolve<IHtmlTitleRetriever>();
// 4. "Execute" the actual code to do the work
Console.WriteLine(retriever.GetTitle(new Uri(ConfigurationManager.AppSettings["fileUri"])));
Console.Read();
// 5. Release the container
container.Dispose();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment