상속: IConfigurationProvider
예제 #1
0
        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);
        }
예제 #2
0
        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();
        }