// Update the query, which updates the icon_view public void UpdateQuery() { if (preventUpdate) { return; } if (sepBox != null) { sepBox.Hide(); } if (rootTerm.Count == 0) { help.Show(); query.ExtraCondition = null; } else { help.Hide(); query.ExtraCondition = rootTerm.SqlCondition(); //Console.WriteLine ("extra_condition = {0}", query.ExtraCondition); } EventHandler handler = Changed; if (handler != null) { handler(this, new EventArgs()); } }
// Update the query, which updates the icon_view public void UpdateQuery() { if (preventUpdate) { return; } if (sepBox != null) { sepBox.Hide(); } if (rootTerm.Count == 0) { help.Show(); query.TagTerm = null; } else { help.Hide(); query.TagTerm = new ConditionWrapper(rootTerm.SqlCondition()); } EventHandler handler = Changed; if (handler != null) { handler(this, new EventArgs()); } }
// Recursively generate the SQL condition clause that this // term represents. public virtual string SqlCondition() { StringBuilder condition = new StringBuilder("("); for (int i = 0; i < SubTerms.Count; i++) { Term term = SubTerms[i] as Term; condition.Append(term.SqlCondition()); if (i != SubTerms.Count - 1) { condition.Append(SQLOperator()); } } condition.Append(")"); return(condition.ToString()); }