Created
April 10, 2013 15:19
-
-
Save DavidSSL/5355558 to your computer and use it in GitHub Desktop.
This file contains 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 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