コード例 #1
0
ファイル: NbfcService.cs プロジェクト: zetorian/nbfc
        private void StopServiceHost()
        {
            try
            {
                if (this.host != null)
                {
                    if (this.host.State == CommunicationState.Faulted)
                    {
                        this.host.Abort();
                    }
                    else
                    {
                        this.host.Close();
                    }

                    this.host = null;
                }
            }
            finally
            {
                if (this.service != null)
                {
                    this.service.Dispose();
                    this.service = null;
                }
            }
        }
コード例 #2
0
ファイル: NbfcService.cs プロジェクト: tenrius/nbfc
        protected override void OnStart(string[] args)
        {
            StopServiceHost();

            this.service = new FanControlService();
            this.host    = new ServiceHost(service);
            this.host.Open();
        }
コード例 #3
0
ファイル: NbfcService.cs プロジェクト: zetorian/nbfc
        protected override void OnStart(string[] args)
        {
            logger.Info("Starting NoteBookFanControlService");
            StopServiceHost();

            this.service = new FanControlService();
            this.host    = new ServiceHost(service);
            this.host.Open();
        }