public void SendJson(string json)
        {
            object o = JsonSerialization.DeserializeMessage(json);

            typeof(Sender <>).CloseAndBuildAs <ISender>(o.GetType())
            .Send(o, this);
        }
Beispiel #2
0
        public void SendJson(string json)
        {
            try
            {
                object o = JsonSerialization.DeserializeMessage(json);

                typeof(Sender <>).CloseAndBuildAs <ISender>(o.GetType())
                .Send(o, this);
            }
            catch (Exception e)
            {
                Console.WriteLine("Unable to deserialize a json message:");
                ConsoleWriter.Write(ConsoleColor.Yellow, e.ToString());
            }
        }