public wDBRowCollection Where(string columnName, wDBComparison comparison, string what) { List<wDBRow> result = new List<wDBRow>(); for(int i = 0; i < this.rows.Count; i++) { string value = this.rows[i][columnName]; bool keep = false; switch (comparison) { case wDBComparison.Equals: if (value == what) keep = true; break; case wDBComparison.Equals_NotCaseSensitive: if (value.ToLower() == what.ToLower()) keep = true; break; case wDBComparison.NotEquals_NotCaseSensitive: if (value.ToLower() != what.ToLower()) keep = true; break; case wDBComparison.NotEquals: if (value != what) keep = true; break; } if (keep) result.Add(this.rows[i]); } return new wDBRowCollection(this.path, result); }
public wDBRowCollection Where(string columnName, wDBComparison comparison, string what) { List <wDBRow> result = new List <wDBRow>(); for (int i = 0; i < this.rows.Count; i++) { string value = this.rows[i][columnName]; bool keep = false; switch (comparison) { case wDBComparison.Equals: if (value == what) { keep = true; } break; case wDBComparison.Equals_NotCaseSensitive: if (value.ToLower() == what.ToLower()) { keep = true; } break; case wDBComparison.NotEquals_NotCaseSensitive: if (value.ToLower() != what.ToLower()) { keep = true; } break; case wDBComparison.NotEquals: if (value != what) { keep = true; } break; } if (keep) { result.Add(this.rows[i]); } } return(new wDBRowCollection(this.path, result)); }