Skip to content

Commit fa05913

Browse files
committed
specify licensee and license key in connect form
1 parent 01726cd commit fa05913

File tree

5 files changed

+131
-31
lines changed

5 files changed

+131
-31
lines changed

.NET/Examples/WindowsDesktop/Components/ConnectControl.Designer.cs

Lines changed: 97 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.NET/Examples/WindowsDesktop/Components/ConnectControl.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using System.Drawing;
34
using System.Linq;
45
using System.Windows.Forms;
@@ -42,6 +43,9 @@ public ConnectControl(UR ur)
4243
_rtdeInputSetup = parameters.Rtde.InputSetup;
4344

4445
UpdateRtdeIndicators();
46+
47+
txtLicensee.Text = Config.Current.Licensee;
48+
txtKey.Text = Config.Current.Key;
4549
}
4650

4751
#region IUserControl
@@ -88,8 +92,12 @@ private void btnConnect_Click(object sender, EventArgs e)
8892

8993
// Store information
9094
Config.Current.ConnectParameters = parameters;
95+
Config.Current.Licensee = txtLicensee.Text;
96+
Config.Current.Key = txtKey.Text;
9197
Config.Save();
9298

99+
UR.RegisterLicense(txtLicensee.Text, txtKey.Text);
100+
93101
// Connect to the robot
94102
_ur.Connect(parameters);
95103

@@ -152,4 +160,14 @@ private void radioV1_CheckedChanged(object sender, EventArgs e)
152160
lblHz.Enabled = enabled;
153161
lblFrequency.Enabled = enabled;
154162
}
163+
164+
private void btnConnect_Click(object sender, KeyEventArgs e)
165+
{
166+
167+
}
168+
169+
private void linkLicense_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
170+
{
171+
Process.Start("https://underautomation.com/license");
172+
}
155173
}

.NET/Examples/WindowsDesktop/Components/LicenseControl.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ public LicenseControl()
2626

2727
public bool FeatureEnabled => _licenseValid;
2828

29-
public void PeriodicUpdate() { }
29+
public void PeriodicUpdate()
30+
{
31+
if (txtLicensee.Text != Config.Current.Licensee || txtKey.Text != Config.Current.Key)
32+
{
33+
txtLicensee.Text = Config.Current.Licensee;
34+
txtKey.Text = Config.Current.Key;
35+
UpdateLicenseControls();
36+
}
37+
}
3038

3139
public void OnClose() { }
3240

.NET/Examples/WindowsDesktop/MainForm.Designer.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.NET/Examples/WindowsDesktop/MainForm.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
126126
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
127127
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABE
128-
CAAAAk1TRnQBSQFMAgEBAgEAAUABAAFAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
128+
CAAAAk1TRnQBSQFMAgEBAgEAAUgBAAFIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
129129
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
130130
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
131131
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

0 commit comments

Comments
 (0)