コード例 #1
0
ファイル: GameOver.xaml.cs プロジェクト: lengocluyen/pescode
        void GameOver_Loaded(object sender, RoutedEventArgs e)
        {
            service.GetChallengeIDCompleted += new EventHandler<PhuThuyDuaThu.GameServices.GetChallengeIDCompletedEventArgs>(service_GetChallengeIDCompleted);
            service.UpdateScoreCompleted += new EventHandler<PhuThuyDuaThu.GameServices.UpdateScoreCompletedEventArgs>(service_UpdateScoreCompleted);

            ctrlNumber = new MapNumbersToImages(GlobalVarialble.Points, Constants.YellowNumber, 30, 30, true);
            ctrlNumber.SetValue(Canvas.LeftProperty, (double)200);
            ctrlNumber.SetValue(Canvas.TopProperty, (double)240);

            this.canvasGameOver.Children.Add(ctrlNumber);
        }
コード例 #2
0
ファイル: Play.xaml.cs プロジェクト: lengocluyen/pescode
        private void SetRandomMailBoxNumber()
        {
            TransformGroup tranformGr = new TransformGroup();
            ScaleTransform scaleTf = new ScaleTransform();
            SkewTransform skewTf = new SkewTransform();
            RotateTransform rotateTf = new RotateTransform();
            TranslateTransform translateTf = new TranslateTransform();

            tranformGr.Children.Add(scaleTf);
            tranformGr.Children.Add(skewTf);
            tranformGr.Children.Add(rotateTf);
            tranformGr.Children.Add(translateTf);

            //Remove all exists ctrlMailBoxNumber before Add
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber01) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber01);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber02) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber02);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber03) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber03);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber04) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber04);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber05) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber05);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber06) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber06);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber07) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber07);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber08) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber08);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber09) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber09);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber10) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber10);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber11) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber11);
            if (canvasMailBoxNumber.Children.Contains(ctrlMailBoxNumber12) == true)
                canvasMailBoxNumber.Children.Remove(ctrlMailBoxNumber12);
            //END

            int numBox01 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox01);
            ctrlMailBoxNumber01 = new MapNumbersToImages(numBox01, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber01.Name = "ctrlMailBoxNumber01";
            ctrlMailBoxNumber01.RenderTransform = tranformGr;
            ctrlMailBoxNumber01.SetValue(Canvas.LeftProperty, (double)66);
            ctrlMailBoxNumber01.SetValue(Canvas.TopProperty, (double)527);
            ctrlMailBoxNumber01.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox02 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox02);
            ctrlMailBoxNumber02 = new MapNumbersToImages(numBox02, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber02.Name = "ctrlMailBoxNumber02";
            ctrlMailBoxNumber02.RenderTransform = tranformGr;
            ctrlMailBoxNumber02.SetValue(Canvas.LeftProperty, (double)206);
            ctrlMailBoxNumber02.SetValue(Canvas.TopProperty, (double)527);
            ctrlMailBoxNumber02.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox03 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox03);
            ctrlMailBoxNumber03 = new MapNumbersToImages(numBox03, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber03.Name = "ctrlMailBoxNumber03";
            ctrlMailBoxNumber03.RenderTransform = tranformGr;
            ctrlMailBoxNumber03.SetValue(Canvas.LeftProperty, (double)350);
            ctrlMailBoxNumber03.SetValue(Canvas.TopProperty, (double)527);
            ctrlMailBoxNumber03.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox04 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox04);
            ctrlMailBoxNumber04 = new MapNumbersToImages(numBox04, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber04.Name = "ctrlMailBoxNumber04";
            ctrlMailBoxNumber04.RenderTransform = tranformGr;
            ctrlMailBoxNumber04.SetValue(Canvas.LeftProperty, (double)491);
            ctrlMailBoxNumber04.SetValue(Canvas.TopProperty, (double)527);
            ctrlMailBoxNumber04.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox05 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox05);
            ctrlMailBoxNumber05 = new MapNumbersToImages(numBox05, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber05.Name = "ctrlMailBoxNumber05";
            ctrlMailBoxNumber05.RenderTransform = tranformGr;
            ctrlMailBoxNumber05.SetValue(Canvas.LeftProperty, (double)66);
            ctrlMailBoxNumber05.SetValue(Canvas.TopProperty, (double)639);
            ctrlMailBoxNumber05.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox06 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox06);
            ctrlMailBoxNumber06 = new MapNumbersToImages(numBox06, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber06.Name = "ctrlMailBoxNumber06";
            ctrlMailBoxNumber06.RenderTransform = tranformGr;
            ctrlMailBoxNumber06.SetValue(Canvas.LeftProperty, (double)206);
            ctrlMailBoxNumber06.SetValue(Canvas.TopProperty, (double)639);
            ctrlMailBoxNumber06.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox07 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox07);
            ctrlMailBoxNumber07 = new MapNumbersToImages(numBox07, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber07.Name = "ctrlMailBoxNumber07";
            ctrlMailBoxNumber07.RenderTransform = tranformGr;
            ctrlMailBoxNumber07.SetValue(Canvas.LeftProperty, (double)350);
            ctrlMailBoxNumber07.SetValue(Canvas.TopProperty, (double)639);
            ctrlMailBoxNumber07.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox08 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox08);
            ctrlMailBoxNumber08 = new MapNumbersToImages(numBox08, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber08.Name = "ctrlMailBoxNumber08";
            ctrlMailBoxNumber08.RenderTransform = tranformGr;
            ctrlMailBoxNumber08.SetValue(Canvas.LeftProperty, (double)491);
            ctrlMailBoxNumber08.SetValue(Canvas.TopProperty, (double)639);
            ctrlMailBoxNumber08.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox09 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox09);
            ctrlMailBoxNumber09 = new MapNumbersToImages(numBox09, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber09.Name = "ctrlMailBoxNumber09";
            ctrlMailBoxNumber09.RenderTransform = tranformGr;
            ctrlMailBoxNumber09.SetValue(Canvas.LeftProperty, (double)66);
            ctrlMailBoxNumber09.SetValue(Canvas.TopProperty, (double)746);
            ctrlMailBoxNumber09.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox10 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox10);
            ctrlMailBoxNumber10 = new MapNumbersToImages(numBox10, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber10.Name = "ctrlMailBoxNumber10";
            ctrlMailBoxNumber10.RenderTransform = tranformGr;
            ctrlMailBoxNumber10.SetValue(Canvas.LeftProperty, (double)208);
            ctrlMailBoxNumber10.SetValue(Canvas.TopProperty, (double)746);
            ctrlMailBoxNumber10.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox11 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox11);
            ctrlMailBoxNumber11 = new MapNumbersToImages(numBox11, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber11.Name = "ctrlMailBoxNumber11";
            ctrlMailBoxNumber11.RenderTransform = tranformGr;
            ctrlMailBoxNumber11.SetValue(Canvas.LeftProperty, (double)350);
            ctrlMailBoxNumber11.SetValue(Canvas.TopProperty, (double)746);
            ctrlMailBoxNumber11.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            int numBox12 = Commons.GetRandomNumberMailBox(Constants.Mailbox_Number_From, Constants.Mailbox_Number_To);
            Commons.AddToMailBoxListNumber(numBox12);
            ctrlMailBoxNumber12 = new MapNumbersToImages(numBox12, Constants.BoldYellowNumber, 15, 15, false);
            ctrlMailBoxNumber12.Name = "ctrlMailBoxNumber12";
            ctrlMailBoxNumber12.RenderTransform = tranformGr;
            ctrlMailBoxNumber12.SetValue(Canvas.LeftProperty, (double)491);
            ctrlMailBoxNumber12.SetValue(Canvas.TopProperty, (double)746);
            ctrlMailBoxNumber12.SetValue(RenderTransformOriginProperty, new Point(0.5, 0.5));

            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber01);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber02);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber03);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber04);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber05);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber06);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber07);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber08);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber09);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber10);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber11);
            canvasMailBoxNumber.Children.Add(ctrlMailBoxNumber12);
        }
コード例 #3
0
ファイル: Play.xaml.cs プロジェクト: lengocluyen/pescode
 private void SetTotalTask(int _totalTask)
 {
     if (canvasPlay.Children.Contains(numberTotalTask) == true)
         canvasPlay.Children.Remove(numberTotalTask);
     numberTotalTask = new MapNumbersToImages(_totalTask, Constants.GreenNumber, 20, 20, true);
     numberTotalTask.SetValue(Canvas.LeftProperty, (double)315);
     numberTotalTask.SetValue(Canvas.TopProperty, (double)15);
     canvasPlay.Children.Add(numberTotalTask);
 }
コード例 #4
0
ファイル: Play.xaml.cs プロジェクト: lengocluyen/pescode
 private void SetCompletedTask(int _numberDone)
 {
     if (canvasPlay.Children.Contains(numberCompletedTask) == true)
         canvasPlay.Children.Remove(numberCompletedTask);
     numberCompletedTask = new MapNumbersToImages(_numberDone, Constants.PinkNumber, 20, 20, true);
     numberCompletedTask.SetValue(Canvas.LeftProperty, (double)264);
     numberCompletedTask.SetValue(Canvas.TopProperty, (double)15);
     canvasPlay.Children.Add(numberCompletedTask);
 }
コード例 #5
0
ファイル: Play.xaml.cs プロジェクト: lengocluyen/pescode
 private void SetNumberOfQuestion(int _numberOfMailBox)
 {
     if (canvasPlay.Children.Contains(numberMailBox) == true)
         canvasPlay.Children.Remove(numberMailBox);
     numberMailBox = new MapNumbersToImages(_numberOfMailBox, Constants.YellowNumber, 23, 23, false);
     numberMailBox.SetValue(Canvas.LeftProperty, (double)113);
     numberMailBox.SetValue(Canvas.TopProperty, (double)433);
     canvasPlay.Children.Add(numberMailBox);
 }
コード例 #6
0
ファイル: Play.xaml.cs プロジェクト: lengocluyen/pescode
 private void SetLevel(int _level)
 {
     if (canvasPlay.Children.Contains(numberLevel) == true)
         canvasPlay.Children.Remove(numberLevel);
     numberLevel = new MapNumbersToImages(_level, Constants.YellowNumber, 20, 20, true);
     numberLevel.SetValue(Canvas.LeftProperty, (double)98);
     numberLevel.SetValue(Canvas.TopProperty, (double)15);
     canvasPlay.Children.Add(numberLevel);
 }
コード例 #7
0
ファイル: Play.xaml.cs プロジェクト: lengocluyen/pescode
 private void SetPointAsImage(int _points)
 {
     if (canvasPlay.Children.Contains(numberPoint) == true)
         canvasPlay.Children.Remove(numberPoint);
     numberPoint = new MapNumbersToImages(_points, Constants.BoldYellowNumber, 17, 17, true);
     numberPoint.SetValue(Canvas.LeftProperty, (double)456);
     numberPoint.SetValue(Canvas.TopProperty, (double)16);
     canvasPlay.Children.Add(numberPoint);
 }