示例#1
0
        /// <summary>
        /// Gets a pen with specified settings.
        /// </summary>
        /// <param name="color">Color of a pen.</param>
        /// <param name="width">Width of a pen.</param>
        /// <param name="style">Dash style of a pen.</param>
        /// <returns>The <b>Pen</b> object.</returns>
        public Pen GetPen(Color color, float width, DashStyle style)
        {
            int hash   = color.GetHashCode() ^ width.GetHashCode() ^ style.GetHashCode();
            Pen result = FPens[hash] as Pen;

            if (result == null)
            {
                result           = new Pen(color, width);
                result.DashStyle = style;
                FPens[hash]      = result;
            }
            return(result);
        }
示例#2
0
        /// <summary>
        /// Gets a pen with specified settings.
        /// </summary>
        /// <param name="color">Color of a pen.</param>
        /// <param name="width">Width of a pen.</param>
        /// <param name="style">Dash style of a pen.</param>
        /// <param name="lineJoin">Line join of a pen.</param>
        /// <returns>The <b>Pen</b> object.</returns>
        public Pen GetPen(Color color, float width, DashStyle style, LineJoin lineJoin)
        {
            int hash   = color.GetHashCode() ^ width.GetHashCode() ^ style.GetHashCode() ^ lineJoin.GetHashCode();
            Pen result = pens[hash] as Pen;

            if (result == null)
            {
                result           = new Pen(color, width);
                result.DashStyle = style;
                result.LineJoin  = lineJoin;
                pens[hash]       = result;
            }
            return(result);
        }
示例#3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Thickness.GetHashCode();
         hashCode = (hashCode * 397) ^ (StrokeColor != null ? StrokeColor.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DashStyle != null ? DashStyle.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DashCap.GetHashCode();
         hashCode = (hashCode * 397) ^ StartLineCap.GetHashCode();
         hashCode = (hashCode * 397) ^ EndLineCap.GetHashCode();
         hashCode = (hashCode * 397) ^ LineJoin.GetHashCode();
         return(hashCode);
     }
 }
示例#4
0
 private Int32 computeHashCode()
 {
     return(Alignment.GetHashCode() ^
            getSingleArrayHashCode(CompoundArray) ^
            MiterLimit.GetHashCode() ^
            BackgroundBrush.GetHashCode() ^
            DashOffset.GetHashCode() ^
            getSingleArrayHashCode(DashPattern) ^
            getStyleBrushesArrayHashCode(DashBrushes) ^
            DashStyle.GetHashCode() ^
            StartCap.GetHashCode() ^
            EndCap.GetHashCode() ^
            DashCap.GetHashCode() ^
            LineJoin.GetHashCode() ^
            Transform.GetHashCode() ^
            Width.GetHashCode() ^
            -18133844);
 }
示例#5
0
 public override int GetHashCode()
 {
     return(DashStyle.GetHashCode() ^ ShowSteps.GetHashCode());
 }
示例#6
0
 public override int GetHashCode()
 {
     return(color.GetHashCode() ^ width.GetHashCode() ^ dashstyle.GetHashCode());
 }