Esempio n. 1
0
        private void stopServiceBtn_Click(object sender, EventArgs e)
        {
            if (_selectedService == null)
            {
                throw new InvalidOperationException("Service is not selected!");
            }

            try
            {
                UpdateSingleServiceInfo(_remoteServiceManagerClient.StopService(_selectedService.ServiceName));
            }
            catch (Exception ex)
            {
                if (_remoteServiceManagerClient.State == CommunicationState.Faulted)
                {
                    _remoteServiceManagerClient.Abort();
                    _remoteServiceManagerClient = new RemoteServiceManagerClient("NetTcpBinding_IRemoteServiceManager");
                }
                MessageBox.Show(ex.Message);
            }
            finally
            {
                RefreshUi();
            }
        }
Esempio n. 2
0
 // UI EVENTS //////////////////////////////////////////////////////////////////////////////
 private void MainForm_Load(object sender, EventArgs e)
 {
     _remoteServiceManagerClient = new RemoteServiceManagerClient("NetTcpBinding_IRemoteServiceManager");
     _services = _remoteServiceManagerClient.GetServices();
     ConfigureGrid();
     RefreshUi();
 }