예제 #1
0
        public DemoService1()
        {
            LogConfigurator.SetupLogger();
            Log.Info(Log.WithCallInfo(LogSourceMoniker), "Ctor invoked", nameof(VersionMoniker), VersionMoniker);

            Log.Info(Log.WithCallInfo(LogSourceMoniker), $"Multi-line {EnvironmentInfo.GetDescription()}");

            InitializeComponent();

            CanStop                     = true; // (default is True)
            CanShutdown                 = true; // (default is False)
            CanPauseAndContinue         = true; // (default is False)
            CanHandleSessionChangeEvent = true; // (default is False)
            CanHandlePowerEvent         = true; // (default is False)
            AutoLog                     = true; // (default is True)

            ServiceName = "Datadog_Demos_WindowsService01";

            _computer     = new Computer();
            _computerTask = null;

            Log.Info(Log.WithCallInfo(LogSourceMoniker), "Ctor completed. Instance created.");
        }