Esempio n. 1
0
		public async Task DestroyMoment (Moment moment)
		{
			using (var handler = new ZumoAuthHeaderHandler ()) 
			{
				using (var client = MobileServiceClientFactory.CreateClient (handler)) 
				{
					await client.GetTable<Moment> ().DeleteAsync (moment);
				}
			}
		}
Esempio n. 2
0
		private async Task SendImageToUsers (string imageUrl, List<User> recipients, int displayTime)
		{
			using (var handler = new ZumoAuthHeaderHandler ()) {
				using (var client = MobileServiceClientFactory.CreateClient (handler)) {
					var senderUserId = AccountService.Instance.User.Id;
					var senderProfileImage = AccountService.Instance.User.ProfileImage;
					var senderName = AccountService.Instance.User.Name;
					var timeSent = DateTime.UtcNow;

					foreach (var user in recipients) {
						var recipientUserId = user.Id;

						var moment = new Moment {
							MomentUrl = imageUrl,
							SenderUserId = senderUserId,
							SenderName = senderName,
							SenderProfileImage = senderProfileImage,
							RecipientUserId = recipientUserId,
							DisplayTime = displayTime,
							TimeSent = timeSent
						};

						Xamarin.Insights.Track ("MomentShared");

						await client.GetTable<Moment> ().InsertAsync (moment);
					}
				}
			}
		}
Esempio n. 3
0
		private async Task DestroyImage (Moment moment)
		{
			Moments.Remove (moment);

			await MomentService.Instance.DestroyMoment (moment);
		}
        private async Task DestroyImage(Moment moment)
        {
            Moments.Remove(moment);

            await MomentService.Instance.DestroyMoment(moment);
        }