Exemplo n.º 1
0
        /// <summary>
        /// This builds the _drawnStates based on the current label scheme.
        /// </summary>
        public virtual void CreateLabels()
        {
            if (FeatureSet != null && FeatureSet.IndexMode)
            {
                CreateIndexedLabels();
                return;
            }

            DrawnStates = new Dictionary <IFeature, LabelDrawState>();
            if (FeatureSet == null || Symbology == null)
            {
                return;
            }

            foreach (ILabelCategory category in Symbology.Categories)
            {
                List <IFeature> features = !string.IsNullOrWhiteSpace(category.FilterExpression) ? FeatureSet.SelectByAttribute(category.FilterExpression) : FeatureSet.Features.ToList();

                foreach (IFeature feature in features)
                {
                    if (DrawnStates.ContainsKey(feature))
                    {
                        DrawnStates[feature] = new LabelDrawState(category);
                    }
                    else
                    {
                        DrawnStates.Add(feature, new LabelDrawState(category));
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This builds the _drawnStates based on the current label scheme.
        /// </summary>
        public virtual void CreateLabels()
        {
            if (FeatureSet != null)
            {
                if (FeatureSet.IndexMode)
                {
                    CreateIndexedLabels();
                    return;
                }
            }
            DrawnStates = new Dictionary <IFeature, LabelDrawState>();
            if (FeatureSet == null)
            {
                return;
            }
            //DataTable dt = _featureSet.DataTable; // if working correctly, this should auto-populate
            if (Symbology == null)
            {
                return;
            }

            foreach (ILabelCategory category in Symbology.Categories)
            {
                List <IFeature> features;
                if (!string.IsNullOrWhiteSpace(category.FilterExpression))
                {
                    features = FeatureSet.SelectByAttribute(category.FilterExpression);
                }
                else
                {
                    features = FeatureSet.Features.ToList();
                }

                foreach (IFeature feature in features)
                {
                    if (DrawnStates.ContainsKey(feature))
                    {
                        DrawnStates[feature] = new LabelDrawState(category);
                    }
                    else
                    {
                        DrawnStates.Add(feature, new LabelDrawState(category));
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// This builds the _drawnStates based on the current label scheme.
        /// </summary>
        public virtual void CreateLabels()
        {
            if (_featureSet != null)
            {
                if (_featureSet.IndexMode)
                {
                    CreateIndexedLabels();
                    return;
                }
            }
            _drawnStates = new Dictionary<IFeature, LabelDrawState>();
            if (_featureSet == null) return;
            //DataTable dt = _featureSet.DataTable; // if working correctly, this should auto-populate
            if (Symbology == null) return;

            foreach (ILabelCategory category in Symbology.Categories)
            {
                List<IFeature> features;
                if (category.FilterExpression != null)
                {
                    features = FeatureSet.SelectByAttribute(category.FilterExpression);
                }
                else
                {
                    features = FeatureSet.Features.ToList();
                }

                foreach (IFeature feature in features)
                {
                    if (_drawnStates.ContainsKey(feature))
                    {
                        _drawnStates[feature] = new LabelDrawState(category);
                    }
                    else
                    {
                        _drawnStates.Add(feature, new LabelDrawState(category));
                    }
                }
            }
        }