void submitScore()
        {
            nameElement.FetchValue();
            scoreElement.FetchValue();
            var gameScore = new GameScore()
            {
                Player    = nameElement.Value,
                Score     = int.Parse(scoreElement.Value),
                Dificulty = (GameDificulty)dificultyGroup.Selected,
            };
            var pfobj = gameScore.ToPfObject();

            Console.WriteLine(pfobj);

            pfobj.SaveAsync((success, error) => {
                UIAlertView alert = new UIAlertView(pfobj.ClassName, string.Format("Success: {0}", success), null, "Ok");
                alert.Show();
            });
        }
Beispiel #2
0
        void submitScore()
        {
            try {
                nameElement.FetchValue();
                scoreElement.FetchValue();
                var gameScore = new GameScore()
                {
                    Player    = nameElement.Value,
                    Score     = int.Parse(scoreElement.Value),
                    Dificulty = (GameDificulty)difficultyGroup.Selected,
                };

                var pfobj = gameScore.ToPfObject();
                Console.WriteLine(pfobj);

                pfobj.SaveAsync((success, error) => {
                    UIAlertView alert = new UIAlertView(pfobj.ClassName, string.Format("Success: {0}", success), null, "Ok");
                    alert.Show();
                });
            } catch (Exception ex) {
                (new UIAlertView("Error", "Please make sure all inputs are valid", null, "Ok")).Show();
            }
        }
        void submitScore()
        {
            try {
                nameElement.FetchValue ();
                scoreElement.FetchValue ();
                var gameScore = new GameScore ()
                {
                    Player = nameElement.Value,
                    Score = int.Parse(scoreElement.Value),
                    Dificulty = (GameDificulty)difficultyGroup.Selected,
                };

                var pfobj = gameScore.ToPfObject ();
                Console.WriteLine (pfobj);

                pfobj.SaveAsync ((success,error) => {
                    UIAlertView alert = new UIAlertView (pfobj.ClassName, string.Format ("Success: {0}", success), null, "Ok");
                    alert.Show ();
                });
            } catch (Exception ex) {
                (new UIAlertView ("Error", "Please make sure all inputs are valid", null, "Ok")).Show ();
            }
        }
        void submitScore()
        {
            nameElement.FetchValue();
            scoreElement.FetchValue();
            var gameScore = new GameScore()
            {
                Player = nameElement.Value,
                Score = int.Parse(scoreElement.Value),
                Dificulty = (GameDificulty)dificultyGroup.Selected,
            };
            var pfobj = gameScore.ToPfObject();
            Console.WriteLine(pfobj);

            pfobj.SaveAsync((success,error)=>{
                UIAlertView alert = new UIAlertView(pfobj.ClassName,string.Format("Success: {0}",success),null,"Ok");
                alert.Show();
            });
        }