コード例 #1
0
ファイル: ScoreViewModel .cs プロジェクト: wigurs/GolfMan
 }                                                           //ORANGE Command
 void OrangeClicked()
 {
     TeeManager.GetTees(TeeID, holeno, 1);
     OrangeDisplay = $"{TeeID[0].Length } m";
     if (Players[0].Gender == 0)
     {
         SlopeManager.GetSlopes(Slopes, 10);
     }
     else
     {
         SlopeManager.GetSlopes(Slopes, 9);
     }
     GetCalculatedSlope();
 }
コード例 #2
0
ファイル: ScoreViewModel .cs プロジェクト: wigurs/GolfMan
 }                                                           //RED Command
 void RedClicked()
 {
     TeeManager.GetTees(TeeID, holeno, 2);
     RedDisplay = $"{TeeID[0].Length } m";
     if (Players[0].Gender == 0)
     {
         SlopeManager.GetSlopes(Slopes, 8);
     }
     else
     {
         SlopeManager.GetSlopes(Slopes, 7);
     }
     GetCalculatedSlope();
 }
コード例 #3
0
ファイル: ScoreViewModel .cs プロジェクト: wigurs/GolfMan
 }                                                           //YELLOW Command
 void YellowClicked()
 {
     TeeManager.GetTees(TeeID, holeno, 4);
     YellowDisplay = $"{TeeID[0].Length } m";
     if (Players[0].Gender == 0)
     {
         SlopeManager.GetSlopes(Slopes, 4);
     }
     else
     {
         SlopeManager.GetSlopes(Slopes, 3);
     }
     GetCalculatedSlope();
 }
コード例 #4
0
ファイル: ScoreViewModel .cs プロジェクト: wigurs/GolfMan
 }                                                           //BLUE Command
 void BlueClicked()
 {
     TeeManager.GetTees(TeeID, holeno, 3);
     BlueDisplay = $"{TeeID[0].Length } m";
     if (Players[0].Gender == 0)
     {
         SlopeManager.GetSlopes(Slopes, 6);
     }
     else
     {
         SlopeManager.GetSlopes(Slopes, 5);
     }
     GetCalculatedSlope();
 }
コード例 #5
0
ファイル: ScoreViewModel .cs プロジェクト: wigurs/GolfMan
        public ScoreViewModel()
        {
            Title = "ScoreCard";

            Scores = new ObservableRangeCollection <Score>();
            //            OpenWebCommand = new Command(() => Device.OpenUri(new Uri("https://xamarin.com/platform")));

            Scores.CollectionChanged += (sender, args) =>
            {
                Debug.WriteLine($"Item {args.Action}");
            };
            GetScoresCommand = new Xamarin.Forms.Command(async() => await GetScoresAsync());

            BirdieCLickedCommand = new Xamarin.Forms.Command(BirdieClicked);
            ParClickedCommand    = new Xamarin.Forms.Command(ParClicked);
            BogeyClickedCommand  = new Xamarin.Forms.Command(BogeyClicked);
            SubmitClickedCommand = new Xamarin.Forms.Command(SubmitClicked);
            IncreaseCountCommand = new Xamarin.Forms.Command(IncreaseCount);
            PlusClickedCommand   = new Command(PlusClicked);
            MinusClickedCommand  = new Command(MinusClicked);
            HoleNoClickedCommand = new Command(HoleNoClicked);

            WhiteClickedCommand  = new Command(WhiteClicked);
            YellowClickedCommand = new Command(YellowClicked);
            BlueClickedCommand   = new Command(BlueClicked);
            RedClickedCommand    = new Command(RedClicked);
            OrangeClickedCommand = new Command(OrangeClicked);

            Courses = new ObservableCollection <Courses>();
            CourseManager.GetCourses(Courses, 1);
            TeeID = new ObservableCollection <Tee>();
            TeeManager.GetTees(TeeID);
            Players = new ObservableCollection <Player>();
            PlayerManager.GetPlayers(Players);
            Slopes = new ObservableCollection <Slope>();
            SlopeManager.GetSlopes(Slopes);
            Scores = new ObservableRangeCollection <Score>();
            ScoreManager.GetScores(Scores, 1);

            BindigContext = this;
            //            BindigContext = new ScoreViewModel();


            InitPlayerData();
        }