/// <summary>Removes the client from the list and possible enables form.</summary> /// <param name="client">The client to kill and remove.</param> private void removeClient(ImportExport client) { try { try { client.CancelAsync(null); //client.Connection_Disconnect(); } catch { } client.Dispose(); //Remove it from the list. this._Clients.Remove(client); //Null it out. client = null; if (this._Clients.Count == 0) { //Enable form. this.btnRefresh.IsEnabled = true; this.btnShowClosed.IsEnabled = true; this.barLoading.Visibility = Visibility.Collapsed; } } catch (Exception ex) { Connect.logEventMessage("wpfProjectTree::removeClient", ex, System.Diagnostics.EventLogEntryType.Error); } }