コード例 #1
0
ファイル: MilSymbolBase.cs プロジェクト: HillHouse/MilSym
        /// <summary>
        /// Sets the brush for unframed lines and fills
        /// </summary>
        /// <param name="fillBrush">
        /// The fill brush to use for unframed lines and fills.
        /// </param>
        private void SetUnframedLineFills(Brush fillBrush)
        {
            if (fillBrush == null)
            {
                return;
            }

            // Use brush to find fill styles
            this.fill             = MilBrush.GetFill(fillBrush);
            this.unframedLineFill = MilBrush.GetLineFillPresent(fillBrush);
            this.unframedLineFill = new Style(typeof(Shape))
            {
                BasedOn = this.unframedLineFill
            };
            this.unframedLineFill.Setters.Add(new Setter(Shape.StrokeProperty, fillBrush));
        }
コード例 #2
0
ファイル: MilSymbolBase.cs プロジェクト: HillHouse/MilSym
        /// <summary>
        /// Sets the standard line and fill brush.
        /// </summary>
        /// <param name="lineBrush">
        /// The line brush to be used for lines.
        /// </param>
        /// <param name="fillBrush">
        /// The fill brush to be used for fills.
        /// </param>
        private void SetLineFills(Brush lineBrush, Brush fillBrush)
        {
            if (fillBrush == null)
            {
                return;
            }

            // Use brush to find fill styles
            this.fill     = MilBrush.GetFill(fillBrush);
            this.lineFill = MilBrush.GetLineFillPresent(fillBrush);
            if (lineBrush != null)
            {
                this.lineFill = new Style(typeof(Shape))
                {
                    BasedOn = this.lineFill
                };
                this.lineFill.Setters.Add(new Setter(Shape.StrokeProperty, lineBrush));
            }

            this.brush = fillBrush;        // may need this brush for unframed symbols
        }