コード例 #1
0
ファイル: PShimCmdletExtensions.cs プロジェクト: adv12/pshim
        public static IBrush GetBrush(this Cmdlet cmdlet, Brush brushType, string colorString, string backgroundString)
        {
            Rgba32 rgbaColor      = cmdlet.ParseColor(colorString);
            Rgba32 rgbaBackground = cmdlet.ParseColor(backgroundString);
            Color  color          = new Color(rgbaColor);
            Color  background     = new Color(rgbaBackground);

            switch (brushType)
            {
            case Brush.Horizontal:
                return(Brushes.Horizontal(color, background));

            case Brush.Vertical:
                return(Brushes.Vertical(color, background));

            case Brush.ForwardDiagonal:
                return(Brushes.ForwardDiagonal(color, background));

            case Brush.BackwardDiagonal:
                return(Brushes.BackwardDiagonal(color, background));

            case Brush.Min:
                return(Brushes.Min(color, background));

            case Brush.Percent10:
                return(Brushes.Percent10(color, background));

            case Brush.Percent20:
                return(Brushes.Percent20(color, background));

            default:
                return(Brushes.Solid(color));
            }
        }
コード例 #2
0
ファイル: PShimCmdletExtensions.cs プロジェクト: adv12/pshim
        public static IPen GetPen(this Cmdlet cmdlet, Pen penType, float width, string colorString)
        {
            Rgba32 rgbaColor = cmdlet.ParseColor(colorString);
            Color  color     = new Color(rgbaColor);

            switch (penType)
            {
            case Pen.Dash:
                return(Pens.Dash(color, width));

            case Pen.DashDot:
                return(Pens.DashDot(color, width));

            case Pen.DashDotDot:
                return(Pens.DashDotDot(color, width));

            case Pen.Dot:
                return(Pens.Dot(color, width));

            default:
                return(Pens.Solid(color, width));
            }
        }