private void Configure() { _categories = new PolygonCategoryCollection(); OnIncludeCategories(_categories); PolygonCategory def = new(); _categories.Add(def); }
/// <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; }
/// <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); }