Ejemplo 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);
				}
			}
		}
Ejemplo 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);
					}
				}
			}
		}
Ejemplo n.º 3
0
		private async Task DestroyImage (Moment moment)
		{
			Moments.Remove (moment);

			await MomentService.Instance.DestroyMoment (moment);
		}
Ejemplo n.º 4
0
        private async Task DestroyImage(Moment moment)
        {
            Moments.Remove(moment);

            await MomentService.Instance.DestroyMoment(moment);
        }