public bool ConnectToFactory(int factoryID) { factoryListener.ClearAllObservers(); try { return(loginService.connectToFactory(sessionID, factoryID)); } catch (EndpointNotFoundException) { ClientServerEvent(this, new ClientServerEventArgs()); } catch (FaultException) { ClientServerEvent(this, new ClientServerEventArgs("Fehler auf Server")); } return(false); }
public void Logout() { try { loginService.disconnect(sessionID); factoryListener.ClearAllObservers(); userListener.ClearAllObservers(); username = null; sessionID = -1; } catch (EndpointNotFoundException) { ClientServerEvent(this, new ClientServerEventArgs()); } catch (FaultException) { ClientServerEvent(this, new ClientServerEventArgs("Fehler auf Server")); } }