private void MyInputboxKeyDown(clientPack thisPack, KeyEventArgs e) { thisPack.InputBox.Background = Brushes.White; if (e.Key == Key.Enter) { MyInputClick(thisPack); } }
private void CheckWin(clientPack thisPack, clientPack comparePack, string input) { for (int i = comparePack.LogList.Items.Count - 1; i >= 0; i--) { if (comparePack.LogList.Items[i].ToString() == input) { comparePack.MatchList.Items.Add(thisPack.ServerName + " " + input); break; } } }
private void MyInputClick(clientPack thisPack) { if (thisPack.InputBox.Text.Length < 4) { thisPack.InputBox.Background = Brushes.Red; return; } CheckWin(thisPack, clientPacks[0], thisPack.InputBox.Text); CheckWin(thisPack, clientPacks[1], thisPack.InputBox.Text); CheckWin(thisPack, clientPacks[2], thisPack.InputBox.Text); CheckWin(thisPack, clientPacks[3], thisPack.InputBox.Text); thisPack.LogList.Items.Add(thisPack.InputBox.Text); if (++thisPack.LineCount > 5) { thisPack.LogList.Items.RemoveAt(0); } thisPack.InputBox.Text = ""; }
private void MatchClearButton3_Click(object sender, RoutedEventArgs e) { clientPack thisPack = clientPacks[3]; thisPack.MatchList.Items.Clear(); }
private void InputBox3_KeyDown(object sender, KeyEventArgs e) { clientPack thisPack = clientPacks[3]; MyInputboxKeyDown(thisPack, e); }
private void InputButton3_Click(object sender, RoutedEventArgs e) { clientPack thisPack = clientPacks[3]; MyInputClick(thisPack); }