示例#1
0
        public override ISvgNodeRenderer CreateDeepCopy()
        {
            UseSvgNodeRenderer copy = new UseSvgNodeRenderer();

            DeepCopyAttributesAndStyles(copy);
            return(copy);
        }
示例#2
0
        public virtual void DeepCopyTest()
        {
            UseSvgNodeRenderer expected = new UseSvgNodeRenderer();

            expected.SetAttribute(SvgConstants.Attributes.HREF, "#blue.svg");
            ISvgNodeRenderer actual = expected.CreateDeepCopy();

            NUnit.Framework.Assert.AreEqual(expected, actual);
        }
示例#3
0
        public virtual void ReferenceNotFoundTest()
        {
            DummySvgNodeRenderer renderer    = new DummySvgNodeRenderer();
            SvgDrawContext       context     = new SvgDrawContext(null, null);
            PdfDocument          pdfDocument = new PdfDocument(new PdfWriter(new ByteArrayOutputStream()));
            PdfPage page = pdfDocument.AddNewPage();

            context.PushCanvas(new PdfCanvas(page));
            ISvgNodeRenderer use = new UseSvgNodeRenderer();

            use.SetAttribute(SvgConstants.Attributes.HREF, "dummy");
            use.Draw(context);
            pdfDocument.Close();
            NUnit.Framework.Assert.IsFalse(renderer.IsDrawn());
        }