Esempio n. 1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            if (args.Contains("/i"))
            {
                try
                {
                    defaultLogger.PropertyChanged += LogToConsole;
                    var watcher = new BuildWatcher(defaultLogger);
                    PublisherFactory.InstantiatePublishers(defaultLogger, watcher);

                    watcher.BuildCompletionEvent += watcher_BuildCompletionEvent;
                    watcher.BuildQualityChangeEvent += watcher_BuildQualityChangeEvent;
                    watcher.Start();
                    defaultLogger.Information("Build Monitor started");
                }
                catch (Exception ex)
                {
                    defaultLogger.Error(ex.Message);
                }

                Console.ReadKey();
                return;
            }

            ServiceBase.Run(new ServiceBase[] { new TFSBuildMonitor() });
        }
 public DelcomBuildPublisher(ILog log, BuildWatcher buildWatcher)
 {
     watcher = buildWatcher;
     watcher.BuildCompletionEvent += watcher_BuildCompletionEvent;
     watcher.BuildQualityChangeEvent += watcher_BuildQualityChangeEvent;
     watcher.BuildWatcherInitializing += Init;
     watcher.BuildWatcherStopping += Close;
     this.log = log;
 }
        protected override void OnStart(string[] args)
        {
            try
            {
                watcher = new BuildWatcher(logger);
                PublisherFactory.InstantiatePublishers(logger, watcher);

                watcher.BuildCompletionEvent += watcher_BuildCompletionEvent;
                watcher.BuildQualityChangeEvent += watcher_BuildQualityChangeEvent;
                watcher.Start();
                logger.Information("Build Monitor started");
            }
            catch (Exception ex)
            {
                base.EventLog.WriteEntry(ex.Message);
                ExitCode = 1;
                logger.Error(ex.Message);
            }
        }