using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using ThinkGeo.MapSuite.Core; namespace CSHowDoISamples.Getting_Started { public static class FeatureLayersExtension { public static Collection GetAllFeatures(this Collection layers, ReturningColumnsType returningColumnsType) { return layers.OfType().GetAllFeatures(returningColumnsType); } public static Collection GetAllFeatures(this IEnumerable featureLayers, ReturningColumnsType returningColumnsType) { Collection features = new Collection(); foreach (FeatureLayer featureLayer in featureLayers) { featureLayer.Open(); Collection queriedFeatures = featureLayer.QueryTools.GetAllFeatures(returningColumnsType); foreach (Feature feature in queriedFeatures) { features.Add(feature); } featureLayer.Close(); } return features; } } }