Exemplo n.º 1
0
        private static string Serialize(object value)
        {
            var             xmlResult = new StringBuilder();
            IDocumentWriter document  = new NXmlDocumentWriter();
            var             xmlWriter = new NXmlWriter(document, null, null);

            xmlWriter.Write(value, new StringWriter(xmlResult));
            return(xmlResult.ToString());
        }
Exemplo n.º 2
0
        public void MemoryUsageSpike_Binary_WriteOnly()
        {
            var source = GetSource();

            IDocumentWriter document  = new NXmlDocumentWriter();
            var             xmlWriter = new NXmlWriter(document, null, null);

            xmlWriter.Write(source, null); //>>>
        }
Exemplo n.º 3
0
        protected static string SerializeAsXml(object value, IApplicationObjectsRepository repository,
                                               IMigrationRulesBuilder migrationRulesBuilder)
        {
            var             xmlResult = new StringBuilder();
            IDocumentWriter document  = new NXmlDocumentWriter();
            var             xmlWriter = new NXmlWriter(document, repository, migrationRulesBuilder, new TestPlugins());

            xmlWriter.Write(value, new StringWriter(xmlResult));
            return(xmlResult.ToString());
        }