Mrudul Ganpule

Mrudul Ganpule

  • NA
  • 23
  • 24.8k

web browser control not initiate if backgroundworker running

May 2 2014 2:15 AM
when i click on connection button this backgroundWorkerStartupProcessLoader start:

  private void backgroundWorkerStartupProcessLoader_DoWork(object sender, DoWorkEventArgs e)
{
//constructor of web browser
OAuthPopup oauthPopup = new OAuthPopup(_ippRealmOAuthProfile);
}

//OAuthPopup .cs
 public OAuthPopup(IppRealmOAuthProfile ippRealmOAuthProfile)
        {           
            try
            {
                   initializeComponent()  ;    
                  _ippRealmOAuthProfile = ippRealmOAuthProfile;
                   readConsumerKeysFromConfiguration();
                   startOAuthHandshake();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
               
            }              
        }

     #region " Redirect to Service Provider - IPP "     
     
        private void redirectToIppForUserAuthorization(OnlineQBO.DevDefined.OAuth.Framework.IToken requestToken)
        {
            try
            {
                // put existing web browser code in here
                    var oauthUserAuthorizeUrl = "https://appcenter.intuit.com/Connect/Begin";
                    this.oauthBrowser.Navigate(oauthUserAuthorizeUrl + "?oauth_token=" + requestToken.Token + "&oauth_callback=" +                               OnlineQBO.DevDefined.OAuth.Framework.UriUtility.UrlEncode(_dummyProtocol + _dummyHost));                                      
             
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
           
        }

        #endregion
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
           
        }

I got the error when the intializeComponent() or  oauthBrowser.Navigate method called.
actual problem is whenever backgroungworker start , he is not going to initiate UI control(web browser)

Please help me ..

Answers (2)