private SearchClauseControl AddSearchControl(SearchClauseControl control)
        {
            // initialize the control
            control.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            control.Location = new Point(12, 6 + m_searchControls.Count * 27);
            control.Width = search_panel.Width - 24;

            // add to the panel
            m_searchControls.Add(control);
            search_panel.Controls.Add(control);

            // add the click handler
            control.RemoveClicked += new EventHandler(searchControl_RemoveClicked);

            // send it back
            return control;
        }
 private void RemoveSearchControl(SearchClauseControl control)
 {
     search_panel.Controls.Remove(control);
     control.RemoveClicked -= searchControl_RemoveClicked;
     control.Dispose();
 }
 private static string GetComparisonOpFormat(SearchClauseControl.ComparisonOp op)
 {
     switch (op)
     {
         case SearchClauseControl.ComparisonOp.Equals:
             return "{0} = {1}";
         case SearchClauseControl.ComparisonOp.NotEquals:
             return "{0} <> {1}";
         case SearchClauseControl.ComparisonOp.Like:
             return "{0} LIKE '%' || {1} || '%'";
         case SearchClauseControl.ComparisonOp.NotLike:
             return "{0} NOT LIKE '%' || {1} || '%'";
         case SearchClauseControl.ComparisonOp.LessThan:
             return "{0} < {1}";
         case SearchClauseControl.ComparisonOp.LessThanOrEqual:
             return "{0} <= {1}";
         case SearchClauseControl.ComparisonOp.GreaterThan:
             return "{0} > {1}";
         case SearchClauseControl.ComparisonOp.GreaterThanOrEqual:
             return "{0} >= {1}";
         default:
             throw new InvalidOperationException("Don't know how to construct where clause for ComparisonOp" + op);
     }
 }