示例#1
0
        private void LoadFavicon()
        {
            var favicon = Favicon.Load();

            if (favicon != null)
            {
                this.Icon = favicon;
            }
        }
示例#2
0
 private void btn_obtainIcon_Click(object sender, EventArgs e)
 {
     if (m_tempGesture.Action == null)
     {
         return;
     }
     switch (m_tempGesture.Action.Name)
     {
     case InternetOptions.INTERNET_OPEN_WEBSITE:
     case InternetOptions.INTERNET_SEARCH_WEB:
         if (!m_obtainingIcon)
         {
             Bitmap favicon = Favicon.Load(tB_address.Text);
             if (favicon != null)
             {
                 pB_icon.Image = favicon;
             }
             else
             {
                 tB_address.Enabled = false;
                 //btn_obtainIcon.Enabled = false;
                 btn_obtainIcon.Text    = Translation.Btn_cancel;
                 m_cursor               = this.Cursor;
                 this.Cursor            = Cursors.WaitCursor;
                 m_webIconExtractor.Url = tB_address.Text;
                 m_webIconExtractor.ObtainIcon();
                 m_obtainingIcon = true;
             }
         }
         else
         {
             m_webIconExtractor.StopThread();
             m_obtainingIcon     = false;
             tB_address.Enabled  = true;
             btn_obtainIcon.Text = Translation.GetText("C_SearchOpenWeb_btn_getIcon");     //"Get Web Icon";
             this.Cursor         = m_cursor;
         }
         break;
     }
 }