Exemplo n.º 1
0
        public static Pet createPet( Generic_RandomPet random, Generic_PetDetails details)
        {
            Pet currentPet = new Pet(// Pet Creation
                   check_pet_id(random.genericPet.data.video.pet_id),
                   check_pet_name(random.genericPet.data.video.pet.name),
                   check_pet_race(details.genericPetDetails.data.pet.race_name),
                   check_pet_specie(details.genericPetDetails.data.pet.species_name),
                   check_pet_description(random.genericPet.data.video.pet.description),
                   check_pet_nextCounts(random.genericPet.data.video.pet.next_count),
                   check_pet_birthDate(random.genericPet.data.video.pet.date_of_birth),
                   check_pet_createdDate(random.genericPet.data.video.pet.created_datetime),
                   check_pet_availableUntilDate(details.genericPetDetails.data.pet.available_until),
                   check_pet_currentVideo(random.genericPet.data.video.video_link, random.genericPet.data.video.title)
                   );

            currentPet.setDetails(// Pet details fill
                check_shelter_id(details.genericPetDetails.data.pet.organization_id),
                check_shelter_phoneNumber(details.genericPetDetails.data.pet.organization.contact_number),
                check_shelter_name(details.genericPetDetails.data.pet.organization.name),
                check_shelter_adress(details.genericPetDetails.data.pet.organization.address),
                check_shelter_email(details.genericPetDetails.data.pet.organization.email),
                check_shelter_creationDate(details.genericPetDetails.data.pet.organization.created_datetime),
                check_pet_videoList(details.genericPetDetails.data.pet.videos));

            return currentPet;
        }
Exemplo n.º 2
0
        //method that will handle downloaded jsons
        public void process()
        {
            lock (_locker)
                while (!_go)
                {
                    Monitor.Wait(_locker);    //Wait for download completion
                }

            if (!error_encountered)
            {

                this.generic_randomPet = new Generic_RandomPet(this.downloadedJsonPet); //Generic pet that fits to it's Json Structure
                this.generic_petDetails = new Generic_PetDetails(this.downloadedJsonPetDetails); //Generic pet details that fits to it's Json Structure

                currentPet = Checker.createPet(generic_randomPet, generic_petDetails);

                System.Diagnostics.Debug.WriteLine("DONE PROCESS 2 !!");

            }
            _go = false;
        }