Beispiel #1
0
        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();
                }
            }
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        // 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;
            }
        }
Beispiel #4
0
 public override string Validate(ref string text)
 {
     text = WormNetCharTable.RemoveNonWormNetChars(text.Trim());
     return(string.Empty);
 }