annotate Implab/Xml/XmlDefaultSerializer.cs @ 281:e0916ddc9950 v3 tip

code cleanup and refactoring
author cin
date Fri, 01 Jun 2018 21:35:24 +0300
parents 6691aff01de1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
278
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
1 using System.Xml.Serialization;
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
2 using Implab.Components;
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
3
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
4 namespace Implab.Xml {
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
5 /// <summary>
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
6 /// This class used to get default serializer for the specified type <typeparamref name="T"/>.
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
7 /// </summary>
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
8 /// <typeparam name="T">The type used to create <see cref="XmlSerializer"/></typeparam>
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
9 public static class XmlDefaultSerializer<T> {
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
10 static readonly LazyAndWeak<XmlSerializer> m_instance = new LazyAndWeak<XmlSerializer>(() => new XmlSerializer(typeof(T)));
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
11
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
12 public static XmlSerializer Instance { get { return m_instance.Value; } }
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
13 }
6691aff01de1 Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
cin
parents:
diff changeset
14 }