private void SyncOnlineBtn_Click(object sender, EventArgs e) { var onlineChoose = new OnlineChoose(); SetNativeEnabled(false); onlineChoose.FormClosing += (s, ev) => { SetNativeEnabled(true); if (onlineChoose.DialogResult == DialogResult.OK) { if (onlineChoose.Host) { ReadySync(() => FolderSync.Sync(new ServerSync(onlineChoose.Port))); } else { ReadySync(() => FolderSync.Sync(new ClientSync(onlineChoose.IP, onlineChoose.Port))); } } }; onlineChoose.Show(); }
private void FriendRoomBtn_Click(object sender, EventArgs e) { if (NetRoomPeer.CurrentRoom != null) { return; } SetNativeEnabled(false); // Asks for the name of the theme. TextInput.GetInput("Enter a username:"******"Friend Room", username => { if (username == "") { SetNativeEnabled(true); return; } Settings.Default.username = username; Settings.Default.Save(); var onlineChoose = new OnlineChoose(); onlineChoose.FormClosing += (s, ev) => { SetNativeEnabled(true); if (onlineChoose.DialogResult == DialogResult.OK) { if (onlineChoose.Host) { NetRoomServer.Begin(username, onlineChoose.Port); } else { NetRoomClient.Begin(username, onlineChoose.IP, onlineChoose.Port); } } }; onlineChoose.Show(); }, Settings.Default.username); }