forked from petabridge/akka-bootcamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGithubAuth.cs
47 lines (42 loc) · 1.4 KB
/
GithubAuth.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Akka.Actor;
using GithubActors.Actors;
namespace GithubActors
{
public partial class GithubAuth : Form
{
private IActorRef _authActor;
public GithubAuth()
{
InitializeComponent();
}
private void GithubAuth_Load(object sender, EventArgs e)
{
linkGhLabel.Links.Add(new LinkLabel.Link() { LinkData = "https://help.github.com/articles/creating-an-access-token-for-command-line-use/" });
_authActor =
Program.GithubActors.ActorOf(Props.Create(() => new GithubAuthenticationActor(lblAuthStatus, this)), ActorPaths.GithubAuthenticatorActor.Name);
}
private void linkGhLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
var link = e.Link.LinkData as string;
if (link != null)
{
//Send the URL to the operating system via windows shell
Process.Start(link);
}
}
private void btnAuthenticate_Click(object sender, EventArgs e)
{
_authActor.Tell(new GithubAuthenticationActor.Authenticate(tbOAuth.Text));
}
}
}