コード例 #1
0
ファイル: Program.cs プロジェクト: kevinmcmahon/chatsworth
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        private static void Main(string[] args)
        {
            bool runAsConsoleApp = false;

            if (args.Length > 0 && string.Equals("/console", args[0]))
            {
                runAsConsoleApp = true;
            }

            if (runAsConsoleApp)
            {
                using (var serviceRunner = new ChatsworthServiceRunner())
                {
                    serviceRunner.Start();
                    Console.ReadLine();
                }
            }
            else
            {
                var ServicesToRun = new ServiceBase[]
                                        {
                                            new ChatsworthService()
                                        };
                ServiceBase.Run(ServicesToRun);
            }
        }
コード例 #2
0
        /// <summary>
        /// Ctor
        /// </summary>
        public ChatsworthService()
        {
            InitializeComponent();

            _serviceRunner = new ChatsworthServiceRunner();
        }