Ejemplo n.º 1
0
        /// <summary>
        /// Async method that updates the organizer list and all of the containing cells.
        /// </summary>
        /// <returns></returns>
        async Task UpdateOrganizers()
        {
            User[] participants = await HttpUtils.GetJsonInfo <User[]>(
                new List <KeyValuePair <string, string> >
            {
            }, "http://haydenszymanski.me/softeng05/get_organizers.php");     // get all current organizers

            List <TextCell> organizerCells = new List <TextCell>();

            Device.BeginInvokeOnMainThread(() => // create an empty list of textcells
            {
                foreach (User participant in participants)
                {
                    TextCell temp = new TextCell                     // for each participant in the list create a new cell.
                    {
                        Text   = "Username : "******"Id : " + participant.Id
                    };
                    organizerCells.Add(temp);           // add that cell to the temporary list
                }
                Organizer.ItemsSource = organizerCells; // set the list in gui to the temp list
            });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Async method that updates the participant list and all of the containing cells.
        /// </summary>
        /// <returns></returns>
        async Task UpdateParticipants()
        {
            User[] participants = await HttpUtils.GetJsonInfo <User[]>(
                new List <KeyValuePair <string, string> >
            {
            }, "http://haydenszymanski.me/softeng05/get_participants.php"); // get all current participant

            List <TextCell> participantCells = new List <TextCell>();       // create an empty list of textcells


            Device.BeginInvokeOnMainThread(() =>  // Containing body executes after any await call
            {
                foreach (User participant in participants)
                {
                    TextCell temp = new TextCell // for each participant in the list create a new cell.
                    {
                        Text   = "Username : "******"Id : " + participant.Id
                    };
                    participantCells.Add(temp);             // add that cell to the temporary list
                }
                Participant.ItemsSource = participantCells; // set the list in gui to the temp list.
            });
        }