Esempio n. 1
0
        void DoBrowse()
        {
            FeatureTrackingManager.Instance.UseFeature(Features.Web_Browse);

            string uri = TextBoxUrl.Text;

            // If they are holding down CTRL, add www.XYZ.com to XYZ
            if ((Keyboard.Modifiers & ModifierKeys.Control) > 0)
            {
                if (!uri.EndsWith(".com"))
                {
                    uri = uri + ".com";
                }
                if (!uri.StartsWith("www.") && !uri.StartsWith("http"))
                {
                    uri = "www." + uri;
                }
                TextBoxUrl.Text = uri;
            }


            // If they are missing http:// or the like, then add it
            if (uri.Contains('.') && !Uri.IsWellFormedUriString(uri, UriKind.Absolute))
            {
                string http_uri = "http://" + uri;
                if (Uri.IsWellFormedUriString(http_uri, UriKind.Absolute))
                {
                    uri             = http_uri;
                    TextBoxUrl.Text = http_uri;
                }
            }

            if (Uri.IsWellFormedUriString(uri, UriKind.Absolute))
            {
                CurrentWebBrowserControl.Navigate(new Uri(uri));
            }
            else
            {
                DoWebSearch(uri);
            }

            // Reselect all text so that it is easy to retype
            TextBoxUrl.SelectAll();
        }
Esempio n. 2
0
 void ButtonBack_Click(object sender, RoutedEventArgs e)
 {
     CurrentWebBrowserControl.GoBack();
 }
Esempio n. 3
0
 void ButtonForward_Click(object sender, RoutedEventArgs e)
 {
     CurrentWebBrowserControl.GoForward();
 }