/// <summary>
        /// Get the singleton instance of this class
        /// </summary>
        /// <returns></returns>
        public static NodesSerializer GetInstance()
        {
            if (_instance == null)
            {
                _instance = new NodesSerializer();
            }

            return(_instance);
        }
Esempio n. 2
0
 /// <summary>
 /// Serialize the field to and Xml Stream
 /// </summary>
 /// <param name="writer"></param>
 public void Serialize(XmlWriter writer)
 {
     if (isNative)
     {
         writer.WriteElementString(Name, Value.ToString());
     }
     else
     {
         XmlSerializer serializer = NodesSerializer.GetInstance().GetCustomSerializer(FieldType, Name);
         serializer.Serialize(writer, Value);
     }
 }