private void AttributeSelector_AttributeAdded(object pSender, ctlAttributeSelector.AttributeEventArgs pArgs) { string strWhere = txtWhereExpression.Text.Trim(); if (strWhere.Length != 0) { strWhere += " AND "; } strWhere += "(" + pArgs.Attribute + "=?)"; while (strWhere.IndexOf(" ") >= 0) { strWhere = strWhere.Replace(" ", " "); } txtWhereExpression.Text = strWhere; }
private void AttributeSelector_AttributeRemoved(object pSender, ctlAttributeSelector.AttributeEventArgs pArgs) { string strWhere = txtWhereExpression.Text.Trim(); if (strWhere.IndexOf("AND (" + pArgs.Attribute + "=?)") >= 0) { strWhere = strWhere.Replace("AND (" + pArgs.Attribute + "=?)", "").Trim(); } else if (strWhere.IndexOf("(" + pArgs.Attribute + "=?) AND") >= 0) { strWhere = strWhere.Replace("(" + pArgs.Attribute + "=?) AND", "").Trim(); } else if (strWhere.IndexOf("(" + pArgs.Attribute + "=?)") >= 0) { strWhere = strWhere.Replace("(" + pArgs.Attribute + "=?)", "").Trim(); } while (strWhere.IndexOf(" ") >= 0) { strWhere = strWhere.Replace(" ", " "); } txtWhereExpression.Text = strWhere; }