/// <summary> /// Adds an array of points to the end of the collection. /// </summary> /// <param name="array">The value to be added to the end of the collection.</param> public void AddArray(PointsArray array) { if (array == null) { throw new ArgumentNullException(); } PointsArray newArr = new PointsArray(); newArr.Page = _page; newArr.AddRange(array.ToArray()); newArr.ChangedPointsArray += changedPointsArray; _array.AddItem(newArr.Array); _listArrays.Add(newArr); if (ChangedInkList != null) { ChangedInkList(this); } }
internal PolygonPolylineAnnotation(PointsArray points, IDocumentEssential owner) : base(null) { if (points == null) { throw new ArgumentNullException("points"); } if (points.Page != null) { _pointsArray = new PointsArray(); _pointsArray.AddRange(points.ToArray()); } else { _pointsArray = points; } _pointsArray.ChangedPointsArray += changedPointsArray; Dictionary.AddItem("Vertices", _pointsArray.Array); Color = new ColorRGB(0, 0, 0); }
//TODO: Measure //TODO: IT internal override Annotation Clone(IDocumentEssential owner, Page page) { if (Page == null) { if (_coordinates == null) { initCoordinates(); } PointF[] points = _coordinates.ToArray(); ApplyOwner(owner); SetPage(page, true); _coordinates.Clear(); _coordinates.Page = page; _coordinates.AddRange(points); return(this); } PDFDictionary res = AnnotationBase.Copy(Dictionary); MarkupAnnotationBase.CopyTo(Dictionary, res); string[] keys = { "LE", "IC", "LL", "LLE", "Cap", "IT", "LLO", "CP", "CO" }; for (int i = 0; i < keys.Length; ++i) { IPDFObject obj = Dictionary[keys[i]]; if (obj != null) { res.AddItem(keys[i], obj.Clone()); } } PDFArray l = Dictionary["L"] as PDFArray; if (l != null) { RectangleF oldRect; if (Page == null) { oldRect = new RectangleF(); } else { oldRect = Page.PageRect; } res.AddItem("L", CloneUtility.CopyArrayCoordinates(l, oldRect, page.PageRect, Page == null)); } PDFDictionary bs = Dictionary["BS"] as PDFDictionary; if (bs != null) { res.AddItem("BS", AnnotationBorderStyle.Copy(bs)); } PDFDictionary measure = Dictionary["Measure"] as PDFDictionary; if (measure != null) { res.AddItem("Measure", Measure.Copy(measure)); } LineAnnotation annot = new LineAnnotation(res, owner); annot.SetPage(page, true); return(annot); }