Esempio n. 1
0
        /// <summary>
        /// 检验采集服务状态
        /// </summary>
        void checkServiceStatus()
        {
            if (service != null)
            {
                bool running = service.IsRunning();

                if (running)
                {
                    this.btnStart.Enabled                = false;
                    this.btnStop.Enabled                 = true;
                    this.cbSourceSite.Enabled            = false;
                    this.btnLoadLocationCategory.Enabled = false;
                    this.btnDownloadCategory.Enabled     = false;
                    this.panelCategory.Enabled           = false;
                }
                else if (NeedCollectCategories.Any())
                {
                    this.btnStart.Enabled                = true;
                    this.btnStop.Enabled                 = false;
                    this.cbSourceSite.Enabled            = true;
                    this.btnLoadLocationCategory.Enabled = true;
                    this.btnDownloadCategory.Enabled     = true;
                    this.panelCategory.Enabled           = true;
                }
            }
            else
            {
                this.cbSourceSite.Enabled = true;
            }
        }