private void ReceiverOnMessageReceived( object sender, MessageReceivedEventArgs e) { var o = MessageParser.Parse(e.Message); if (o == null) { ParsingFailed?.Invoke( this, new ParsingFailedEventArgs(e.ContactId, e.Message)); return; } var item = new ReminderItem(o.Date, o.Message, e.ContactId, ReminderItemStatus.Awaiting); try { _storage.Add(item); AddingSucceeded?.Invoke( this, new AddingSucceededEventArgs(new AddReminderModel(item))); } catch (Exception exception) { AddingFailed?.Invoke( this, new AddingFailedEventArgs(new AddReminderModel(item), exception)); } }
public void OnAddingFailed(object sender, AddingFailedEventArgs e) { AddingFailed?.Invoke(sender, e); }