static void Main() { var configurationProvider = new ConfigurationProvider { Path = GetConfigPath() }; var errors = configurationProvider.Validate(); if (errors.Count > 0) { errors.ForEach(e => System.Console.WriteLine("ERROR: " + e)); return; } StartService(configurationProvider); }
protected override void OnStart(string[] args) { var configurationProvider = new ConfigurationProvider { Path = GetConfigPath() }; var errors = configurationProvider.Validate(); if (errors.Count > 0) { var message = String.Join("\n", errors); throw new Exception(message); } var hipChatNotifier = new HipChatNotifier(configurationProvider); var notificationHandler = new NotificationHandler(hipChatNotifier, configurationProvider); _host = new ServiceHost(new TfsHipChatEventService(notificationHandler)); _host.Open(); }