Created
February 28, 2010 00:43
-
-
Save phatboyg/317084 to your computer and use it in GitHub Desktop.
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
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
RunConfiguration configuration = RunnerConfigurator.New(x => | |
{ | |
x.SetServiceName("CalebMailService"); | |
x.SetDisplayName("Caleb's Mail Service"); | |
x.SetDescription("Give you some sexy mail service"); | |
x.ConfigureService<MaleService>(c => | |
{ | |
c.HowToBuildService(y => new MaleService()); | |
c.WhenStarted(s => s.Start()); | |
c.WhenStopped(s => s.Stop()); | |
}); | |
}); | |
Runner.Host(configuration, args); | |
} | |
public class MaleService | |
{ | |
public void Start() | |
{ | |
Console.WriteLine("Starting..."); | |
} | |
public void Stop() | |
{ | |
Console.WriteLine("Stopping..."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment