TextMessage CreateTextMessage() { var msg = Generator.ActivateNotification <TextMessage>(); msg.InvokerId = 0; msg.InvokerName = "Invoker"; msg.InvokerUid = "InvokerUid"; msg.Message = ""; msg.Target = MessageTarget.Private; return(msg); }
private static INotification GenerateNotification(string line) { int splitindex = line.IndexOf(' '); if (splitindex < 0) { throw new ArgumentException("line couldn't be parsed"); } Type targetNotification; string notifyname = line.Substring(0, splitindex); if (notifyLookup.TryGetValue(notifyname, out targetNotification)) { var notification = Generator.ActivateNotification(targetNotification); var incommingData = ParseKeyValueLine(line, true); FillQueryMessage(targetNotification, notification, incommingData); return(notification); } else { throw new NotSupportedException("No matching notification derivative"); } }