Пример #1
0
        private BorderPainter()
        {
            RGPen p;

            // Solid
#if WINFORM || WPF
            p = new RGPen(RGPenColor.Black, 1);
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.Solid] = p;

            // Dahsed
#if WINFORM || WPF
            p           = new RGPen(RGPenColor.Black, 1);
            p.DashStyle = RGDashStyles.Dash;
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.Dashed] = p;

            // Dotted
#if WINFORM || WPF
            p           = new RGPen(RGPenColor.Black, 1);
            p.DashStyle = RGDashStyles.Dot;
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.Dotted] = p;

            // DoubleLine
#if WINFORM || WPF
            p = new RGPen(RGPenColor.Black, 3);
#if WINFORM
            p.CompoundArray = new float[] { 0f, 0.2f, 0.8f, 1f };
#endif
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.DoubleLine] = p;

            // Dashed2
#if WINFORM || WPF
            p = new RGPen(RGPenColor.Black, 1);
#if WINFORM
            p.DashPattern = new float[] { 2f, 2f };
#endif
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.Dashed2] = p;

            // DashDot
#if WINFORM || WPF
            p = new RGPen(RGPenColor.Black, 1);
#if WINFORM
            p.DashPattern = new float[] { 10f, 3f, 3f, 3f };
#elif WPF
            p.DashStyle = RGDashStyles.DashDot;
#endif
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.DashDot] = p;

            // DashDotDot
#if WINFORM || WPF
            p = new RGPen(RGPenColor.Black, 1);
#if WINFORM
            p.DashPattern = new float[] { 10f, 3f, 3f, 3f, 3f, 3f };
#elif WPF
            p.DashStyle = RGDashStyles.DashDotDot;
#endif
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID

            pens[(byte)BorderLineStyle.DashDotDot] = p;

            // BoldDashDot
#if WINFORM || WPF
            p           = new RGPen(RGPenColor.Black, 2);
            p.DashStyle = RGDashStyles.DashDot;
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.BoldDashDot] = p;

            // BoldDashDotDot
#if WINFORM || WPF
            p           = new RGPen(RGPenColor.Black, 2);
            p.DashStyle = RGDashStyles.DashDotDot;
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.BoldDashDotDot] = p;

            // BoldDotted
#if WINFORM || WPF
            p           = new RGPen(RGPenColor.Black, 2);
            p.DashStyle = RGDashStyles.Dot;
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.BoldDotted] = p;

            // BoldDashed
#if WINFORM || WPF
            p           = new RGPen(RGPenColor.Black, 2);
            p.DashStyle = RGDashStyles.Dash;
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.BoldDashed] = p;

            // BoldSolid
#if WINFORM || WPF
            p = new RGPen(RGPenColor.Black, 2);
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.BoldSolid] = p;

            // BoldSolidStrong
#if WINFORM || WPF
            p = new RGPen(RGPenColor.Black, 3);
#elif ANDROID
            p       = new RGPen();
            p.Color = Android.Graphics.Color.Black;
            p.SetPathEffect(new DashPathEffect(new float[] { 1, 1 }, 1));
#endif // ANDROID
            pens[(byte)BorderLineStyle.BoldSolidStrong] = p;
        }