public async Task<bool> UpdateAndSendMessage(Message message)
        {
            string uri = MessagesFolder + message.Id;
            var helper = GetHttpHelper();

            if (await helper.PatchItemAsync(uri, message) == null)
            {
                return false;
            }

            await helper.PostItemVoidAsync<Message>(uri + '/' + OData.Send);
            return true;
        }
Пример #2
0
        public async Task <bool> UpdateAndSendMessage(MMM.Message message)
        {
            var newMessage = message.ConvertObject <Microsoft.Graph.Message>();

            if (await _graphClient.Me.Messages[message.Id].Request().UpdateAsync(newMessage) == null)
            {
                return(false);
            }

            await _graphClient.Me.Messages[message.Id].Send().Request().PostAsync();

            return(true);
        }
 private void AddRecipient(Message.Recipient recipient)
 {
     if (!Recipients.Any(x => x.EmailAddress.IsEqualTo(recipient.EmailAddress)))
     {
         Recipients.Add(recipient);
         OnPropertyChanged(() => SendCommand);
     }
 }
        private void DeleteRecipient(Message.Recipient recipient)
        {
            if (recipient == null) return;

            int pos = Recipients.IndexOf(x => x.EmailAddress.IsEqualTo(recipient.EmailAddress));
            Recipients.RemoveAt(pos);
            OnPropertyChanged(() => SendCommand);
        }