private void ServerStartButton_OnClick(object Sender, RoutedEventArgs E) { NetworkComponent comp = MainWindow.Player.GetComponent <NetworkComponent>( ); comp.ShutdownServer( ); comp.SetUpNetworkReceiver(Settings.Default.ListenPort); }
private void OnPortChanged(object Sender, RoutedPropertyChangedEventArgs <double?> E) { if (!this.IsPlayerInitialized) { return; } if (!E.NewValue.HasValue) { return; } Settings.Default.ListenPort = ( ushort )E.NewValue; Settings.Default.Save( ); NetworkComponent comp = MainWindow.Player.GetComponent <NetworkComponent>( ); comp.ShutdownServer( ); comp.SetUpNetworkReceiver(Settings.Default.ListenPort); SetQRCodeImage( ); }