public XmlWriterDelegator(XmlWriter writer) { XmlObjectSerializer.CheckNull(writer, nameof(writer)); this.writer = writer; this.dictionaryWriter = writer as XmlDictionaryWriter; }