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); }
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); }