示例#1
0
        public OAuth2Form(OAuth2 oauth)
        {
            InitializeComponent();

              this.oauth = oauth;

              if (oauth.ServiceIcon != null)
            this.Icon = oauth.ServiceIcon;

              if (oauth.ServiceName != "")
            this.Text = "Authorize " + oauth.ServiceName;

              string authURL = oauth.GetAuthorizeURL();
              if (authURL != "")
            this.webAuth.Navigate(authURL);
              else
            this.webAuth.DocumentText = "<!DOCTYPE html><html><body><center><br/><br/><h1>" + this.oauth.ServiceName + " appears to be offline.</h1><p>Try again in a minute!</p><p><a href=\"" + authURL + "\">Retry now</a></p></center></body></html>";
        }