Exemple #1
0
        /// <summary>
        /// Get the points in string format.
        /// </summary>
        /// <returns>String with the point.</returns>
        public async Task <string> GetPointsStringAsync()
        {
            await Task.FromResult(0);

            string result = null;

            List <List <DrawPoint> > linesList = new List <List <DrawPoint> >();

            // The first child is always the current drawing path, and should be ignored.
            if ((points != null) && (points.Count > 1))
            {
                List <DrawPoint>        pointLine;
                System.Drawing.PointF[] line;
                System.Drawing.PointF   point;

                for (int i = 0; i < points.Count; i++)
                {
                    line = points[i];

                    if ((line != null) && (line.Length > 0))
                    {
                        pointLine = new List <DrawPoint>();
                        for (int j = 0; j < line.Length; j++)
                        {
                            point = line[j];
                            pointLine.Add(new DrawPoint(point.X, point.Y));
                        }

                        linesList.Add(pointLine);
                    }
                }

                result = await SignatureSerializer.SerializeAsync(linesList);
            }

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// Get the points in string format.
        /// </summary>
        /// <returns>String with the point.</returns>
        public async Task <string> GetPointsStringAsync()
        {
            await Task.FromResult(0);

            string result = null;

            List <List <DrawPoint> > linesList = new List <List <DrawPoint> >();

            // The first child is always the current drawing path, and should be ignored.
            if ((inkPresenter != null) && (inkPresenter.Children.Count > 1))
            {
                List <DrawPoint> pointLine;
                Polyline         line;
                Point            point;

                for (int i = 0; i < inkPresenter.Children.Count; i++)
                {
                    line = inkPresenter.Children[i] as Polyline;

                    if ((line != null) && (line.Points.Count > 0))
                    {
                        pointLine = new List <DrawPoint>();
                        for (int j = 0; j < line.Points.Count; j++)
                        {
                            point = line.Points[j];
                            pointLine.Add(new DrawPoint(point.X, point.Y));
                        }

                        linesList.Add(pointLine);
                    }
                }

                result = await SignatureSerializer.SerializeAsync(linesList);
            }

            return(result);
        }