public void AddServer(ServerAddress server) { RemoveServer(server.Address, server.Port); RemoveServer(server.Name); ServerAddresses.Add(server); }
private void AddNewClient(string address) { ServerAddresses.Add(address); LANDiscoveryClient discoveryTCP = new LANDiscoveryClient(); DiscoveryTCPs.Add(discoveryTCP); discoveryTCP.Connect(address, PortNum); }
private async Task ButtonAddClicked() { if (!String.IsNullOrEmpty(NewServerAddress) && Uri.IsWellFormedUriString(NewServerAddress, UriKind.Absolute) && (NewServerAddress.StartsWith("http://") || NewServerAddress.StartsWith("https://"))) { ServerAddresses.Add(NewServerAddress); this._addressStorage.Servers.Add(NewServerAddress); NewServerAddress = null; // Notify all other viewmodels that a new server was added. // -> The model does NOT implement INotifyPropertyChanged! this._eventAggregator.GetEvent <ServerAddedEvent>() .Publish(); } }