private void AwayClick(object sender, RoutedEventArgs e) { if (e != null) { e.Handled = true; } if (Away) { Away = false; AwayChanged(this, new BoolEventArgs(Away)); this.Close(); } else { string text = WormNetCharTable.RemoveNonWormNetChars(AwayText.Text.Trim()); if (text.Length > 0) { Away = true; Properties.Settings.Default.AwayMessage = text; Properties.Settings.Default.Save(); AwayChanged(this, new BoolEventArgs(Away)); this.Close(); } } }
public override string Validate(ref string text) { text = WormNetCharTable.RemoveNonWormNetChars(text.Trim()); string[] words = text.ToLower().Split(new char[] { ' ' }); if (words.Length == 3 && words[0] == "great" && words[1] == "snooper" && gsVersionRegex.IsMatch(words[2]) && words[2] != "v" + App.GetVersion()) { return("No trolling please!"); } return(string.Empty); }
// Send a message by the user (action) public void MessageSend(object sender, KeyEventArgs e) { TextBox tb = (TextBox)sender; if (e.Key == Key.Return && tb.Text.Length > 0) { // Remove non-wormnet characters Channel ch = (Channel)tb.DataContext; string message = (ch.Server.IsWormNet) ? message = WormNetCharTable.RemoveNonWormNetChars(tb.Text.TrimEnd()) : tb.Text.TrimEnd(); if (message.Length > 0) { ch.UserMessagesAdd(message); ch.UserMessageLoadedIdx = -1; SendMessageToChannel(message, ch, true); } tb.Clear(); e.Handled = true; } }
public override string Validate(ref string text) { text = WormNetCharTable.RemoveNonWormNetChars(text.Trim()); return(string.Empty); }