Exemplo n.º 1
0
 public static void AddValue(this StageContainer parent, string name, object value, bool onlyIfNotNull = true)
 {
     if (onlyIfNotNull && value == null)
     {
         return;
     }
     parent.Add(SerializationMaster.Stage(name, value));
 }
Exemplo n.º 2
0
        public static string Serialize <T>(T item, bool pretty = false)
        {
            SerializationMaster.EnsureInit();
            StageItem stageItem = SerializationMaster.Stage(typeof(T).Name, item);

            if (stageItem == null)
            {
                return(string.Empty);
            }
            return(SerializationMaster._serializer.Serialize(stageItem, pretty));
        }
Exemplo n.º 3
0
 private static bool TryStage(string name, object value, out StageItem result)
 {
     result = SerializationMaster.Stage(name, value);
     return(result != null);
 }