Example #1
0
        private static async void saveDataOnExitAsync(ZoomPage saveData)
        {
            await Task.Delay(500);

            Debug.WriteLine("DHB:ZoomPage:saveDataOnExitAsync this should print second");
            PhotoUpdateJSON pJSON = new PhotoUpdateJSON();

            pJSON.flag = saveData.flaggedImg.IsVisible;
            pJSON.like = saveData.likedImg.IsVisible;
            //pJSON.tags = saveData.tagEntry.Text;   @todo parse and set tags.
            string jsonQuery = JsonConvert.SerializeObject(pJSON);

            if (jsonQuery != null)
            {
                string apiCall = "update/photo/" + saveData.pid;
                string result  = await GlobalSingletonHelpers.requestFromServerAsync(HttpMethod.Put, apiCall, jsonQuery);
            }
        }
Example #2
0
        private async Task <string> photoUpdate(long pid)
        {
            string          result = "";
            PhotoUpdateJSON pJSON  = new PhotoUpdateJSON();

            //pJSON.flag = saveData.flaggedImg.IsVisible;
            //pJSON.like = saveData.likedImg.IsVisible;
            //pJSON.tags = saveData.tagEntry.Text;   @todo parse and set tags.
            string[] splitters     = { " ", "," };
            string[] tagsAsStrings = tagsEntry.Text.Split(splitters, StringSplitOptions.RemoveEmptyEntries);
            pJSON.tags = new List <string>(tagsAsStrings);
            string jsonQuery = JsonConvert.SerializeObject(pJSON);

            if (jsonQuery != null)
            {
                string apiCall = "update/photo/" + pid;
                result = await GlobalSingletonHelpers.requestFromServerAsync(HttpMethod.Put, apiCall, jsonQuery);
            }
            return(result);
        }