Ejemplo n.º 1
0
        public IPath CreatePath(IList <PathPoint> origins)
        {
            if (origins == null)
            {
                throw new ArgumentNullException(nameof(origins));
            }
            if (origins.Count != 3)
            {
                throw new ArgumentOutOfRangeException(nameof(origins));
            }

            var segments = new PathSegmentList()
            {
                new LinePathSegment()
                {
                    Origin = origins[0]
                },
                new LinePathSegment()
                {
                    Origin = origins[1]
                },
                new LinePathSegment()
                {
                    Origin = origins[2]
                }
            };

            var path = new Path(this, segments);

            return(path);
        }
Ejemplo n.º 2
0
        protected Path(Path prototype)
        {
            if (prototype == null)
            {
                throw new ArgumentNullException(nameof(prototype));
            }

            m_pathGeometry = prototype.m_pathGeometry;
            m_segments     = prototype.m_segments.Clone();
        }
Ejemplo n.º 3
0
        public Path(JToken json)
        {
            if (json == null)
            {
                throw new ArgumentNullException(nameof(json));
            }

            m_pathGeometry = PathGeometryFactory.Create(json[JsonNames.PathGeometry]);
            m_segments     = new PathSegmentList(json[JsonNames.Segments]);
        }
Ejemplo n.º 4
0
 public Path(IPathGeometry pathGeometry, PathSegmentList segments)
 {
     m_pathGeometry = pathGeometry ?? throw new ArgumentNullException(nameof(pathGeometry));
     m_segments     = segments ?? throw new ArgumentNullException(nameof(segments));
 }