Пример #1
0
        /// <summary>
        /// Returns a shallow copy of this category with the exception of
        /// the TextSymbolizer, which is duplicated. This uses memberwise
        /// clone, so sublcasses using this method will return an appropriate
        /// version.
        /// </summary>
        /// <returns>A shallow copy of this object.</returns>
        public virtual LabelCategory Copy()
        {
            if (MemberwiseClone() is not LabelCategory result)
            {
                return(null);
            }

            result.Symbolizer          = Symbolizer.Copy();
            result.SelectionSymbolizer = SelectionSymbolizer.Copy();
            return(result);
        }
Пример #2
0
        /// <summary>
        /// Returns a shallow copy of this category with the exception of
        /// the TextSymbolizer, which is duplicated.  This uses memberwise
        /// clone, so sublcasses using this method will return an appropriate
        /// version.
        /// </summary>
        /// <returns>A shallow copy of this object.</returns>
        public virtual LabelCategory Copy()
        {
            var result = MemberwiseClone() as LabelCategory;

            if (result == null)
            {
                return(null);
            }
            result.Symbolizer          = Symbolizer.Copy();
            result.SelectionSymbolizer = SelectionSymbolizer.Copy();
            return(result);
        }
Пример #3
0
 /// <summary>
 /// Creates a new category based on a symbolizer, and uses the same symbolizer, but with a fill and border color of light cyan
 /// for the selection symbolizer
 /// </summary>
 /// <param name="pointSymbolizer">The symbolizer to use in order to create a category</param>
 public PointCategory(IPointSymbolizer pointSymbolizer)
 {
     Symbolizer          = pointSymbolizer;
     SelectionSymbolizer = pointSymbolizer.Copy();
     SelectionSymbolizer.SetFillColor(Color.Cyan);
 }