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));
            }
        }
Beispiel #2
0
 private void setNameBtn_Click(object sender, EventArgs e)
 {
     AddingSucceeded?.Invoke(new UserAccount(cloudNameBox.Text, createEngine(cloudToken)));
 }
 public void OnAddingSucceeded(object sender, AddingSucceededEventArgs e)
 {
     AddingSucceeded?.Invoke(sender, e);
 }