Ejemplo n.º 1
0
        private void Configure()
        {
            _categories = new PolygonCategoryCollection();
            OnIncludeCategories(_categories);
            PolygonCategory def = new();

            _categories.Add(def);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Handle the event wiring and scheme update for the new categories.
 /// </summary>
 /// <param name="categories">The category collection to update</param>
 protected virtual void OnIncludeCategories(PolygonCategoryCollection categories)
 {
     if (categories == null)
     {
         return;
     }
     categories.Scheme            = this;
     categories.SelectFeatures   += OnSelectFeatures;
     categories.DeselectFeatures += OnDeselectFeatures;
     categories.ItemChanged      += CategoriesItemChanged;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Overrides the copy behavior to remove the now unnecessary SelecTFeatures event handler.
        /// </summary>
        /// <param name="copy"></param>
        protected override void OnCopy(CopyList <IPolygonCategory> copy)
        {
            PolygonCategoryCollection pcc = copy as PolygonCategoryCollection;

            if (pcc != null && pcc.SelectFeatures != null)
            {
                foreach (var handler in pcc.SelectFeatures.GetInvocationList())
                {
                    pcc.SelectFeatures -= (EventHandler <ExpressionEventArgs>)handler;
                }
            }
            base.OnCopy(copy);
        }