private void _btnShutDown_Click(object sender, EventArgs e) { if (_host != null) { _lstReport.Items.Clear(); _host.Shutdown(); _host = null; } }
private void Start(bool silent) { if (_host != null) { _host.Shutdown(); _host = null; } _host = new LeadtoolsWcfHost(); _lstReport.Items.Clear(); _host.Address = _txtAddress.Text; _host.Port = _txtPort.Text; _host.Alias = _txtAlias.Text; _host.Opening += new LeadtoolsWcfHost.OpeningEventHandler(_host_Opening); _host.Opened += new LeadtoolsWcfHost.OpenedEventHandler(_host_Opened); _host.Closing += new LeadtoolsWcfHost.ClosingEventHandler(_host_Closing); _host.Closed += new LeadtoolsWcfHost.ClosedEventHandler(_host_Closed); _host.Start(silent); }