Пример #1
0
        /// <summary>
        /// Saves the configuration file to the specified path.
        /// </summary>
        /// <param name="filePath">The full file path.</param>
        public void Save(string filePath)
        {
            //var serializedData = XmlStringSerializer.Serialize(this);
            var serializedData = JsonStringSerializer.Serialize(this);

            File.WriteAllText(filePath, serializedData);
        }
Пример #2
0
 public string ToJsonString()
 {
     return(JsonStringSerializer.Serialize(this));
 }
Пример #3
0
        public void SerializeNullObjectToNullString()
        {
            IStringSerializer serializer = new JsonStringSerializer();

            Assert.IsNull(serializer.Serialize <object>(null));
        }