コード例 #1
0
        private void move(Turtle tut, int row, int pos, Label label, string player)
        {
            for (int i = 0; i <= row; i++)
            {
                pos++;
                label.Content = (pos);
                if ((pos == 11) || (pos == 31) || (pos == 51) || (pos == 71) || (pos == 91))
                {
                    tut.Left(90);
                    Thread.Sleep(250);
                    tut.Forward(100);
                    tut.Left(90);
                }
                else if ((pos == 21) || (pos == 41) || (pos == 61) || (pos == 81))
                {
                    Thread.Sleep(250);
                    tut.Right(90);
                    tut.Forward(100);
                    tut.Right(90);
                }
                else
                {
                    Thread.Sleep(250);
                    tut.Forward(100);
                }

                if (pos == 100)
                {
                    cw = new congratulations(player);
                    cw.Show();
                    this.Hide();
                }
            }
        }
コード例 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.wn_con = ((PLAYERS.congratulations)(target));
                return;

            case 2:
                this.lbl_winner = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }