private void btnStart_Click(object sender, EventArgs e)
        {
            try
            {
                _enumerationService.Port = int.Parse(mtxtPort.Text);

                _enumerationService.ImagesExtension.Clear( );

                _enumerationService.ImagesExtension.AddRange(txtExtensions.Text.Split(';'));

                _enumerationService.Start( );
            }
            catch (Exception exception)
            {
                Messager.ShowError(this, exception);
            }
        }
Пример #2
0
        private void startToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (!_server.IsRunning)
                {
                    //EventLogger_EventLog
                    Leadtools.Jpip.Logging.EventLogger.EventLog += new EventHandler <Leadtools.Jpip.Logging.EventLogEntry>(EventLogger_EventLog);
                    _server.RequestReceived += new EventHandler <RequestReceivedEventArgs> (_server_RequestReceived);
                    _server.ResponseSending += new EventHandler <ResponseSendingEventArgs> (_server_ResponseSending);
                    _server.Start( );

                    if (_server.Configuration.IPAddress != _service.IpAddress.ToString( ))
                    {
                        if (_service.Running)
                        {
                            _service.Stop( );
                        }

                        _service.IpAddress = System.Net.IPAddress.Parse(_server.Configuration.IPAddress);
                    }

                    if (!_service.Running)
                    {
                        _service.Start( );
                    }
                }

                UpdateUIMenuStsate( );
            }
            catch (Exception exception)
            {
                Leadtools.Jpip.Logging.EventLogger.EventLog -= new EventHandler <Leadtools.Jpip.Logging.EventLogEntry>(EventLogger_EventLog);
                _server.RequestReceived -= new EventHandler <RequestReceivedEventArgs> (_server_RequestReceived);
                _server.ResponseSending -= new EventHandler <ResponseSendingEventArgs> (_server_ResponseSending);

                Messager.ShowError(this, exception);
            }
        }