Skip to content

Commit 0b67b12

Browse files
author
WTDT
committed
Fixed a bug in the licensing manager which was causing an exception. Cleaned up the RegisterContent once I realized that it was a stale dll that was causing the issue, oppsy.
1 parent bf5e28e commit 0b67b12

File tree

5 files changed

+56
-25
lines changed

5 files changed

+56
-25
lines changed
Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<UserControl x:Class="WaveTech.Scutex.Licensing.Gui.RegisterContent"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:ctrls="clr-namespace:WaveTech.Scutex.Licensing.Gui.Controls"
7-
mc:Ignorable="d" Background="Transparent"
8-
d:DesignHeight="300" d:DesignWidth="300">
4+
xmlns:ctrls="clr-namespace:WaveTech.Scutex.Licensing.Gui.Controls"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
Background="Transparent"
8+
d:DesignHeight="300"
9+
d:DesignWidth="300"
10+
mc:Ignorable="d">
911
<Grid>
1012
<Grid.ColumnDefinitions>
1113
<ColumnDefinition />
@@ -18,11 +20,34 @@
1820
<RowDefinition Height="96*" />
1921
</Grid.RowDefinitions>
2022

21-
<TextBlock Grid.Row="0" Text="Please enter your License Key" FontSize="20" Foreground="Azure" VerticalAlignment="Center" HorizontalAlignment="Center"/>
22-
<ctrls:MaskedTextBox x:Name="txtLicenseKey" Grid.Row="1" FontSize="20" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,5,5,5" ></ctrls:MaskedTextBox>
23-
24-
<TextBlock Grid.Row="2" x:Name="lblResult" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" />
25-
<ProgressBar Grid.Row="3" x:Name="pdgActivationProgress" IsIndeterminate="True" Visibility="Collapsed" Margin="0,0,0,2.5"/>
26-
<Button x:Name="btnActivite" Grid.Row="4" Content="Activate this License Key" Margin="15,15,15,15" Click="btnActivite_Click" />
23+
<TextBlock Grid.Row="0"
24+
HorizontalAlignment="Center"
25+
VerticalAlignment="Center"
26+
FontSize="20"
27+
Foreground="Azure"
28+
Text="Please enter your License Key" />
29+
<ctrls:MaskedTextBox x:Name="txtLicenseKey"
30+
Grid.Row="1"
31+
Margin="5,5,5,5"
32+
HorizontalAlignment="Center"
33+
VerticalAlignment="Center"
34+
FontSize="20"
35+
FontWeight="Bold"
36+
InputMask="wwwww-wwwww-wwwww-wwwww-wwwww" />
37+
<TextBlock x:Name="lblResult"
38+
Grid.Row="2"
39+
HorizontalAlignment="Center"
40+
VerticalAlignment="Center"
41+
FontSize="14" />
42+
<ProgressBar x:Name="pdgActivationProgress"
43+
Grid.Row="3"
44+
Margin="0,0,0,2.5"
45+
IsIndeterminate="True"
46+
Visibility="Collapsed" />
47+
<Button x:Name="btnActivite"
48+
Grid.Row="4"
49+
Margin="15,15,15,15"
50+
Click="btnActivite_Click"
51+
Content="Activate this License Key" />
2752
</Grid>
2853
</UserControl>

Applications/Licensing/Gui/RegisterContent.xaml.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public RegisterContent()
3333

3434
_licenseKeyService = ObjectLocator.GetInstance<ILicenseKeyService>();
3535
_registerService = ObjectLocator.GetInstance<IRegisterService>();
36+
37+
3638
}
3739

3840
public RegisterContent(ClientLicense clientLicense, ScutexLicense scutexLicense)
@@ -41,17 +43,17 @@ public RegisterContent(ClientLicense clientLicense, ScutexLicense scutexLicense)
4143
_clientLicense = clientLicense;
4244
_scutexLicense = scutexLicense;
4345

44-
switch (_clientLicense.KeyGeneratorType)
46+
if (_clientLicense != null)
4547
{
46-
case KeyGeneratorTypes.StaticSmall:
47-
txtLicenseKey.InputMask = @"www-wwwwww-wwww";
48-
break;
49-
case KeyGeneratorTypes.StaticLarge:
50-
txtLicenseKey.InputMask = @"wwwww-wwwww-wwwww-wwwww-wwwww";
51-
break;
52-
//default:
53-
// txtLicenseKey.InputMask = @"wwwww-wwwww-wwwww-wwwww-wwwww";
54-
// break;
48+
switch (_clientLicense.KeyGeneratorType)
49+
{
50+
case KeyGeneratorTypes.StaticSmall:
51+
txtLicenseKey.InputMask = @"www-wwwwww-wwww";
52+
break;
53+
case KeyGeneratorTypes.StaticLarge:
54+
txtLicenseKey.InputMask = @"WWWWW-WWWWW-WWWWW-WWWWW-WWWWW";
55+
break;
56+
}
5557
}
5658
}
5759

Applications/Licensing/LicensingManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ public LicensingManager(object instance)
9696
/// </param>
9797
public LicensingManager(object instance, LicensingManagerOptions options)
9898
{
99-
_options = options;
100-
_killOnError = _options.KillOnError;
99+
if (options != null)
100+
{
101+
_options = options;
102+
_killOnError = _options.KillOnError;
103+
}
104+
101105
this.instance = instance;
102106

103107
Bootstrapper.Configure();

Common/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@
6464
// You can specify all the values or you can default the Build and Revision Numbers
6565
// by using the '*' as shown below:
6666
// [assembly: AssemblyVersion("1.0.*")]
67-
[assembly: AssemblyVersion("0.4.1111.2207")] // Rule: *.*.YYMM.DDhh
68-
[assembly: AssemblyFileVersion("0.4.1111.2207")] // Rule: *.*.YYMM.DDhh
67+
[assembly: AssemblyVersion("0.4.1202.2207")] // Rule: *.*.YYMM.DDhh
68+
[assembly: AssemblyFileVersion("0.4.1202.2207")] // Rule: *.*.YYMM.DDhh

lib/WaveTech.Scutex.Licensing.dll

-663 KB
Binary file not shown.

0 commit comments

Comments
 (0)