Skip to content

Commit

Permalink
Changed authorization refresh/obtain event handling slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeiren committed Aug 19, 2013
1 parent 64a8389 commit b5dc793
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions EasyImgur/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ public Form1()
notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon1_MouseDoubleClick);
tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);

ImgurAPI.obtainedAuthorization += new ImgurAPI.AuthorizationEventHandler(this.ObtainedOrRefreshedAPIAuthorization);
ImgurAPI.obtainedAuthorization += new ImgurAPI.AuthorizationEventHandler(this.ObtainedAPIAuthorization);
ImgurAPI.refreshedAuthorization += new ImgurAPI.AuthorizationEventHandler(this.ObtainedAPIAuthorization);
ImgurAPI.refreshedAuthorization += new ImgurAPI.AuthorizationEventHandler(this.ObtainedOrRefreshedAPIAuthorization);
ImgurAPI.refreshedAuthorization += new ImgurAPI.AuthorizationEventHandler(this.RefreshedAPIAuthorization);
ImgurAPI.lostAuthorization += new ImgurAPI.AuthorizationEventHandler(this.LostAPIAuthorization);

notifyIcon1.ShowBalloonTip(2000, "EasyImgur", "Right-click EasyImgur's icon in the tray to use it!", ToolTipIcon.Info);
Expand All @@ -40,17 +42,26 @@ private void ApplicationExit( object sender, EventArgs e )
ImgurAPI.OnMainThreadExit();
}

private void ObtainedAPIAuthorization()
private void ObtainedOrRefreshedAPIAuthorization()
{
uploadClipboardToolStripMenuItem.Enabled = true;
uploadFromFileToolStripMenuItem.Enabled = true;
label13.Text = "Authorized";
label13.ForeColor = System.Drawing.Color.Green;
buttonForceTokenRefresh.Enabled = true;
buttonForgetTokens.Enabled = true;
}

private void ObtainedAPIAuthorization()
{
notifyIcon1.ShowBalloonTip(2000, "EasyImgur", "EasyImgur has received authorization to use your Imgur account!", ToolTipIcon.Info);
}

private void RefreshedAPIAuthorization()
{
notifyIcon1.ShowBalloonTip(2000, "EasyImgur", "EasyImgur has successfully refreshed authorization tokens!", ToolTipIcon.Info);
}

private void LostAPIAuthorization()
{
uploadClipboardToolStripMenuItem.Enabled = false;
Expand Down
Binary file modified dist/Debug/EasyImgur.exe
Binary file not shown.
Binary file modified dist/Release/EasyImgur.exe
Binary file not shown.

0 comments on commit b5dc793

Please sign in to comment.