BrightIdeasSoftware.FilterMenuBuilder.Cluster C# (CSharp) Méthode

Cluster() protected méthode

Create a collection of clusters that should be presented to the user
protected Cluster ( IClusteringStrategy strategy, ObjectListView listView, OLVColumn column ) : List
strategy IClusteringStrategy
listView ObjectListView
column OLVColumn
Résultat List
        protected virtual List<ICluster> Cluster(IClusteringStrategy strategy, ObjectListView listView, OLVColumn column)
        {
            // Build a map that correlates cluster key to clusters
            NullableDictionary<object, ICluster> map = new NullableDictionary<object, ICluster>();
            int count = 0;
            foreach (object model in listView.ObjectsForClustering) {
                this.ClusterOneModel(strategy, map, model);

                if (count++ > this.MaxObjectsToConsider)
                    break;
            }

            // Now that we know exactly how many items are in each cluster, create a label for it
            foreach (ICluster cluster in map.Values)
                cluster.DisplayLabel = strategy.GetClusterDisplayLabel(cluster);

            return new List<ICluster>(map.Values);
        }