예제 #1
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(PointCategoryCollection categories)
 {
     if (categories == null)
     {
         return;
     }
     categories.Scheme            = this;
     categories.ItemChanged      += CategoriesItemChanged;
     categories.SelectFeatures   += OnSelectFeatures;
     categories.DeselectFeatures += OnDeselectFeatures;
 }
        /// <summary>
        /// Overrides the OnCopy method to remove the SelectFeatures handler on the copy
        /// </summary>
        /// <param name="copy"></param>
        protected override void OnCopy(CopyList <IPointCategory> copy)
        {
            PointCategoryCollection pcc = copy as PointCategoryCollection;

            if (pcc != null && pcc.SelectFeatures != null)
            {
                foreach (var handler in pcc.SelectFeatures.GetInvocationList())
                {
                    pcc.SelectFeatures -= (EventHandler <ExpressionEventArgs>)handler;
                }
            }
            base.OnCopy(copy);
        }
예제 #3
0
 private void Configure()
 {
     _categories = new PointCategoryCollection();
     OnIncludeCategories(_categories);
 }