private void OnReceive(Message obj)
{
switch (obj.MessageType)
{
case "Configurations":
var configurations = obj.Payload.ToObject<Incomming.ConfigurationsMessage>();
OnConfigurations(new ConfigurationsEventArgs(obj.ContextId, configurations));
break;
case "References":
var references = obj.Payload.ToObject<Incomming.ReferencesMessage>();
OnReferences(new ReferencesEventArgs(obj.ContextId, references));
break;
case "Diagnostics":
var diagnostics = obj.Payload.ToObject<Incomming.DiagnosticsMessage>();
OnDiagnostics(new DiagnosticsEventArgs(obj.ContextId, diagnostics));
break;
case "Sources":
var sources = obj.Payload.ToObject<Incomming.SourcesMessage>();
OnSources(new SourcesEventArgs(obj.ContextId, sources));
break;
case "Error":
var error = obj.Payload.ToObject<Incomming.ErrorMessage>();
OnError(new HostErrorEventArgs(obj.ContextId, error));
break;
default:
if (Debugger.IsAttached)
Debugger.Break();
break;
}
}