Beispiel #1
0
        /// <summary>
        /// Event handler for web browser status text changes
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">event args</param>
        private void AxWebBrowser_StatusTextChange(
            object sender, DWebBrowserEvents2_StatusTextChangeEvent e)
        {
            // update the status text
            m_statusText = e.text;

            // notify listeners
            OnStatusTextChanged(EventArgs.Empty);
        }
Beispiel #2
0
 /// <summary>
 /// 这里控制状态栏显示鼠标移向的链接
 /// </summary>
 private void AxWebBrowser1_StatusTextChange(object sender, DWebBrowserEvents2_StatusTextChangeEvent e)
 {
     Application.DoEvents();
     labStatus.Text = e.text;
 }
Beispiel #3
0
        private void browser2_StatusTextChange(object sender, DWebBrowserEvents2_StatusTextChangeEvent e)
        {
            if (e.text.StartsWith("Pandora222222222222222"))
            {
                IHTMLDocument2 document = (IHTMLDocument2)browser2.Document;

                IHTMLElement songNameElement = (IHTMLElement)document.all.item("songName", 0);
                IHTMLElement artistNameElement = (IHTMLElement)document.all.item("artistName", 0);
                IHTMLElement songURLElement = (IHTMLElement)document.all.item("songURL", 0);
                IHTMLElement artURLElement = (IHTMLElement)document.all.item("artURL", 0);

                IHTMLElement stationNameElement = (IHTMLElement)document.all.item("stationName", 0);
                IHTMLElement stationIdElement = (IHTMLElement)document.all.item("stationId", 0);
                IHTMLElement stationIsSharedElement = (IHTMLElement)document.all.item("stationIsShared", 0);
                IHTMLElement stationIsQuickMixElement = (IHTMLElement)document.all.item("stationIsQuickMix", 0);

                string songName = (songNameElement != null ? songNameElement.innerText : string.Empty);
                string artistName = (artistNameElement != null ? artistNameElement.innerText : string.Empty);
                string songURL = (songURLElement != null ? songURLElement.innerText : string.Empty);
                string artURL = (artURLElement != null ? artURLElement.innerText : string.Empty);

                string stationName = (stationNameElement != null ? stationNameElement.innerText : string.Empty);
                string stationId = (stationIdElement != null ? stationIdElement.innerText : string.Empty);
                string stationIsShared = (stationIsSharedElement != null ? stationIsSharedElement.innerText : string.Empty);
                string stationIsQuickMix = (stationIsQuickMixElement != null ? stationIsQuickMixElement.innerText : string.Empty);

                if (e.text.StartsWith("Pandora.SongPlayed"))
                {
                    if (song.Name == string.Empty)
                    {
                        song.Name = songName;
                        song.Artist = artistName;
                    }
                    else
                    {
                        nextSong = new Song(string.Empty, songName, artistName);
                    }
                }
                else if (e.text.StartsWith("Pandora.StationPlayed"))
                {
                    Debug.WriteLine("Changed station to " + stationName);

                    currentStationCode = stationId;

                    foreach (MenuItem menuItem in menuPlayerStations.MenuItems)
                    {
                        menuItem.Checked = false;
                    }

                    if (bool.Parse(stationIsQuickMix))
                    {
                        menuPlayerStationQuickmix.Checked = true;
                    }
                    else
                    {
                        Station currentStation = null;

                        foreach (Station station in stations)
                        {
                            if (station.Code.Equals(currentStationCode))
                            {
                                currentStation = station;
                                break;
                            }
                        }

                        if (currentStation != null)
                        {
                            foreach (MenuItem menuItem in menuPlayerStations.MenuItems)
                            {
                                if (menuItem.Text.Equals(currentStation.Name))
                                {
                                    menuItem.Checked = true;
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
 void Browser_StatusTextChange(object sender,
                               DWebBrowserEvents2_StatusTextChangeEvent e)
 {
     // Change the status text to the text emitted by IE
     BrowserStatusText.Text = e.text;
 }
Beispiel #5
0
 /// <summary>
 /// 这里控制状态栏显示鼠标移向的链接
 /// </summary>
 private void AxWebBrowser1_StatusTextChange(object sender, DWebBrowserEvents2_StatusTextChangeEvent e)
 {
     labStatus.Text = e.text;
 }
Beispiel #6
0
 protected void AxWebBrowser_StatusTextChange(object sender, DWebBrowserEvents2_StatusTextChangeEvent e)
 {
     StatusMessages.Text = e.text;
 }
        // *********************************************************************

        // *********************************************************************
        // Handle the WebBrowser's status text change event
        private void StatusTextChange(object sender, DWebBrowserEvents2_StatusTextChangeEvent e)
        {
            appStatusBar.Text = e.text;
        }