コード例 #1
0
        public override object Clone(
            File context
            )
        {
            PdfStream clone = (PdfStream)MemberwiseClone();

            {
                // Deep cloning...
                clone.header = (PdfDictionary)header.Clone(context);
                clone.body   = (IBuffer)body.Clone();
            }
            return(clone);
        }
コード例 #2
0
ファイル: Cloner.cs プロジェクト: flaklypa/pdfclown-sign
        public override PdfObject Visit(
            PdfDictionary obj,
            object data
            )
        {
            Filter        cloneFilter = MatchFilter(obj);
            PdfDictionary clone       = (PdfDictionary)obj.Clone();

            {
                clone.entries = new Dictionary <PdfName, PdfDirectObject>();
                foreach (KeyValuePair <PdfName, PdfDirectObject> entry in obj.entries)
                {
                    PdfDirectObject sourceValue = entry.Value;
                    if (cloneFilter.BeforeClone(this, obj, clone, entry.Key, sourceValue))
                    {
                        PdfDirectObject cloneValue;
                        clone[entry.Key] = cloneValue = (PdfDirectObject)(sourceValue != null ? sourceValue.Accept(this, null) : null);
                        cloneFilter.AfterClone(this, obj, clone, entry.Key, cloneValue);
                    }
                }
            }
            cloneFilter.AfterClone(this, obj, clone);
            return(clone);
        }