예제 #1
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        public XGraphicsPath Clone()
        {
            XGraphicsPath path = (XGraphicsPath)MemberwiseClone();

            _corePath = new CoreGraphicsPath(_corePath);
            return(path);
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="XGraphicsPath"/> class.
        /// </summary>
        public XGraphicsPath()
        {
#if CORE
            _corePath = new CoreGraphicsPath();
#endif
#if GDI
            try
            {
                Lock.EnterGdiPlus();
                _gdipPath = new GraphicsPath();
            }
            finally { Lock.ExitGdiPlus(); }
#endif
#if WPF || NETFX_CORE
            _pathGeometry = new PathGeometry();
#endif
        }
예제 #3
0
 public CoreGraphicsPath(CoreGraphicsPath path)
 {
     _points = new List<XPoint>(path._points);
     _types = new List<byte>(path._types);
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XGraphicsPath"/> class.
 /// </summary>
 public XGraphicsPath()
 {
     _corePath = new CoreGraphicsPath();
 }
예제 #5
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        public XGraphicsPath Clone()
        {
            XGraphicsPath path = (XGraphicsPath)MemberwiseClone();
#if CORE
            _corePath = new CoreGraphicsPath(_corePath);
#endif
#if GDI
            try
            {
                Lock.EnterGdiPlus();
                path._gdipPath = _gdipPath.Clone() as GraphicsPath;
            }
            finally { Lock.ExitGdiPlus(); }
#endif
#if WPF || NETFX_CORE
#if !SILVERLIGHT && !NETFX_CORE
            path._pathGeometry = _pathGeometry.Clone();
#else
            // AG-HACK
            throw new InvalidOperationException("Silverlight cannot clone geometry objects.");
            // TODO: make it manually...
#pragma warning disable 0162
#endif
#endif
            return path;
        }
 public CoreGraphicsPath(CoreGraphicsPath path)
 {
     _points = new List <XPoint>(path._points);
     _types  = new List <byte>(path._types);
 }