Exemple #1
0
 public TakingPicturePage(TakingPicture tp, Attraction attraction)
 {
     InitializeComponent();
     pc = PhotosController.GetInstance();
     gc = GameController.getInstance();
     scoreLabel.Text       = AppResources.score + ": " + gc.GetScore();
     CameraButton.Clicked += CameraButton_Clicked;
     subtitles.Source      = ServerConection.URL_MEDIA + "subtitles.jpg";
     info.Source           = ServerConection.URL_MEDIA + "info.jpg";
     playVideo.Source      = ServerConection.URL_MEDIA + "playVideo.jpg";
     how.Source            = ServerConection.URL_MEDIA + "how.png";
     this.tp         = tp;
     this.attraction = attraction;
 }
Exemple #2
0
        private Entertainment GetEntertainmentByAttraction(Attraction attraction)
        {
            string jsonResponse = SendToServerAndGetResponseBack(new { id = attraction.id, }, "getEntertainment/");

            if (jsonResponse.Equals(""))
            {
                return(null);
            }
            JObject json      = JObject.Parse(jsonResponse);
            string  className = (string)json["className"];
            JObject obj       = (JObject)json["object"];

            if (SlidingPuzzle.isMyClassName(className))
            {
                return(new SlidingPuzzle
                {
                    id = (int)obj["id"],
                    description = (string)obj["description"],
                    piecesURLS = ((JArray)obj["piecesURLS"]).ToObject <List <string> >(),
                    width = (int)obj["width"],
                    height = (int)obj["height"]
                });
            }
            else if (Puzzle.isMyClassName(className))
            {
                return(new Puzzle
                {
                    id = (int)obj["id"],
                    description = (string)obj["description"],
                    piecesURLS = ((JArray)obj["piecesURLS"]).ToObject <List <string> >(),
                    width = (int)obj["width"],
                    height = (int)obj["height"]
                });
            }
            else if (TakingPicture.isMyClassName(className))
            {
                return(new TakingPicture
                {
                    id = (int)obj["id"],
                    description = (string)obj["description"]
                });
            }
            return(null);
        }