internal class CustomRegexStyle : RegexStyle { protected override void DrawCore(System.Collections.Generic.IEnumerable features, GeoCanvas canvas, System.Collections.ObjectModel.Collection labelsInThisLayer, System.Collections.ObjectModel.Collection labelsInAllLayers) { foreach (Feature feature in features) { //string fieldValue = feature.ColumnValues[this.ColumnName].Trim(); //Collection regexItemCollection = GetRegexItems(fieldValue,this.RegexMatchingRule); // The above is the original logic for only one column, you can add your codes to support the multi columns. Feature[] tmpFeatures = new Feature[1] { feature }; foreach (RegexItem regexItem in regexItemCollection) { if (regexItem.CustomStyles.Count == 0) { regexItem.DefaultAreaStyle.Draw(tmpFeatures, canvas, labelsInThisLayer, labelsInAllLayers); regexItem.DefaultLineStyle.Draw(tmpFeatures, canvas, labelsInThisLayer, labelsInAllLayers); regexItem.DefaultPointStyle.Draw(tmpFeatures, canvas, labelsInThisLayer, labelsInAllLayers); regexItem.DefaultTextStyle.Draw(tmpFeatures, canvas, labelsInThisLayer, labelsInAllLayers); } else { foreach (ThinkGeo.MapSuite.Core.Style style in regexItem.CustomStyles) { style.Draw(tmpFeatures, canvas, labelsInThisLayer, labelsInAllLayers); } } } } } private Collection GetRegexItems(string columnValue, RegexMatching regexMatching) { Collection results = new Collection(); if (regexMatching == RegexMatching.MatchFirstOnly) { var matchingItem = this.RegexItems.FirstOrDefault(tmpItem => { Regex regex = new Regex(tmpItem.RegularExpression); return regex.IsMatch(columnValue); }); if (matchingItem != null) results.Add(matchingItem); } else { bool isMatchAll = this.RegexItems.All(tmpItem => { Regex regex = new Regex(tmpItem.RegularExpression); return regex.IsMatch(columnValue); }); if (isMatchAll) { foreach (var item in this.RegexItems) { results.Add(item); } } } return results; } }