Example #1
0
        public static string Serialize(IEnumerable <KeyValuePair <string, object> > value)
        {
            if (value == null)
            {
                return(string.Empty);
            }

            using (var w = new GenxyWriter())
            {
                foreach (var kvp in value)
                {
                    if (!HasValue(kvp.Value))
                    {
                        continue;
                    }

                    w.WriteChar('#');
                    w.WriteString(kvp.Key);
                    w.WriteChar('=');
                    SerializeObject(w, kvp.Value);
                }

                return(w.ToString());
            }
        }
Example #2
0
 public static string SerializeObject(object value)
 {
     using (var w = new GenxyWriter())
     {
         SerializeObject(w, value);
         return(w.ToString());
     }
 }