示例#1
0
        public string ConvertToString(TextPredicate predicate)
        {
            ContainsPhrase_Predicate contains = predicate as ContainsPhrase_Predicate;

            if (contains != null)
            {
                return(this.ConvertToString(contains));
            }

            AndPredicate and = predicate as AndPredicate;

            if (and != null)
            {
                return(this.ConvertToString(and));
            }

            OrPredicate or = predicate as OrPredicate;

            if (or != null)
            {
                return(this.ConvertToString(or));
            }

            NotPredicate not = predicate as NotPredicate;

            if (not != null)
            {
                return(this.ConvertToString(not));
            }

            throw new Exception("Unrecognized predicate: " + predicate);
        }
        private void TextButton_Clicked(object sender, EventArgs e)
        {
            string text = this.newWord_box.Text;

            if (text != null && text != "")
            {
                ContainsPhrase_Predicate word = new ContainsPhrase_Predicate(text);
                this.newWord_box.Text = "";
                this.addChild(word);
                this.updateLayout();
            }
        }
示例#3
0
 public string ConvertToString(ContainsPhrase_Predicate predicate)
 {
     return(this.ConvertToString(predicate.Text, this.ContainsPhrase_Tag));
 }