Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            Uri uri = new Uri("https://en.wikipedia.org/wiki/Main_Page");

            PlayerBrowser.Navigate(uri);
            Target_URI.Navigate("https://www.google.co.uk/");
            MessageBox.Show("Welcome this is the Wikipedia Game," +
                            "the Aim of the game is to get from one wikipedia page to another only using wikipedia hyperlinks," +
                            "the less hyperlinks used the better the score", "The Wikipedia Game Rules");
            WindowState = WindowState.Maximized;
        }
Ejemplo n.º 2
0
        private void NewGame2()
        {
            Uri uri = new Uri("https://en.wikipedia.org/wiki/Special:Random");

            ChangingTitle = true;
            PlayerBrowser.Navigate(uri);
            Target_URI.Navigate(uri);
            Score         = 0;
            Text_         = ("Score : " + Score.ToString());
            ScoreBox.Text = (Text_);
            StartPoint    = (PlayerBrowser.Source);
            EndPoint      = (Target_URI.Source);
        }
Ejemplo n.º 3
0
        private void BackButton_Click(object sender, RoutedEventArgs e)
        {
            if ((PlayerBrowser.Source != new Uri("https://en.wikipedia.org/wiki/Main_Page") &&
                 (PlayerBrowser.Source != StartPoint)))
            {
                PlayerBrowser.GoBack();
            }

            else
            {
                MessageBox.Show("\"Back Button\" cannot be used until there is a webpage to go back to", "Error");
            }
        }