Ejemplo n.º 1
0
        internal static IMedia ConvertToMedia(Gorilla.Wistia.Models.Media media)
        {
            var result = new Media
            {
                Description = media.description,
                Name = media.name,
                Id = media.hashed_id,
                Progress = media.progress,
                Thumbnail = media.thumbnail?.url,
                Duration = media.duration,
                Ready = false
            };

            switch (media.status)
            {
                case "queued":
                    result.Status = UploadStatus.Queued;
                    break;
                case "processing":
                    result.Status = UploadStatus.Processing;
                    break;
                case "ready":
                    result.Ready = true;
                    result.Status = UploadStatus.Ready;
                    break;
                case "failed":
                    result.Status = UploadStatus.Failed;
                    break;
            }

            return result;
        }
Ejemplo n.º 2
0
        public static Mammal CreateMammal(MammalSpecies Species)
        {
            Mammal animalObj = null;//Animaltype unknown at this time.

            //Lets determine users choice of animal.
            switch (Species)
            {
                case MammalSpecies.Cat:
                    animalObj = new Cat();
                    break;
                case MammalSpecies.Dog:
                    animalObj = new Dog();
                    break;
                case MammalSpecies.Gorilla:
                    animalObj = new Gorilla();
                    break;

                default:
                    Debug.Assert(false, "Not implemented");
                    break;
            }

            //Set animal category
            animalObj.Category = CategoryType.Mammal;

            return animalObj;//Return created instance of object.
        }
        public Animal createAnimal(int animalCode)
        {
            Animal newAnimal = null;

            switch (animalCode)
            {
                case 0:
                    newAnimal = new Gorilla();
                    break;
                case 1:
                    newAnimal = new Lion();
                    break;
                case 2:
                    newAnimal = new Elephant();
                    break;
                case 3:
                    newAnimal = new Hippo();
                    break;
                case 4:
                    newAnimal = new Hyena();
                    break;
            }
            return newAnimal;
        }