public static string Serialize(SerializedObject message)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("{");
            sb.AppendFormat("\t\"class\": \"{0}\"", message.Type.AssemblyQualifiedName);
            foreach (var entry in message.Data)
            {
                sb.AppendLine(",");

                string value = Serialize(entry.Value);

                sb.AppendFormat("\t\"{0}\": {1}", entry.Key, value);
            }
            sb.AppendLine();
            sb.Append("}");

            return sb.ToString();
        }
        public string Serialize()
        {
            var persistentProperties = new PropertyDictionary();
            foreach (var entry in properties)
            {
                if ((string)entry.Key == "Initializing")
                    continue;

                if ((string)entry.Key == "Mute")
                    continue;

                if ((string)entry.Key == "Context")
                    continue;

                if ((string)entry.Key == "Id")
                    continue;

                persistentProperties.Add(entry.Key, entry.Value);
            }

            SerializedObject so = new SerializedObject();
            so.Data = persistentProperties;
            so.Type = target.GetType().BaseType;

            return JSONSerializer.Serialize (so) ;
        }