개정판 1305c420
license 추가
Change-Id: I8e7a4286cba7bd95a3475917a96e7b3560c67cb0
Makrus_API_Test/MainWindow.xaml.cs | ||
---|---|---|
12 | 12 |
using System.Windows.Media.Imaging; |
13 | 13 |
using System.Windows.Navigation; |
14 | 14 |
using System.Windows.Shapes; |
15 |
using System.Windows.Threading; |
|
15 | 16 |
|
16 | 17 |
namespace Makrus_API_Test |
17 | 18 |
{ |
... | ... | |
24 | 25 |
{ |
25 | 26 |
InitializeComponent(); |
26 | 27 |
} |
28 |
|
|
29 |
private void Button_Click(object sender, RoutedEventArgs e) |
|
30 |
{ |
|
31 |
try |
|
32 |
{ |
|
33 |
var license = new License.Validator.Valid("http://localhost:44301/License"); |
|
34 |
//var license = new License.Validator.Valid("http://192.168.0.67:8921"); |
|
35 |
license.ValidateError += License_ValidateError; |
|
36 |
|
|
37 |
license.GetLicense("public.xml"); |
|
38 |
license.Activate(); |
|
39 |
|
|
40 |
MessageBox.Show("Actvive"); |
|
41 |
} |
|
42 |
catch (Exception ex) |
|
43 |
{ |
|
44 |
MessageBox.Show("License Validate Error"); |
|
45 |
} |
|
46 |
} |
|
47 |
|
|
48 |
private void License_ValidateError(object sender, License.Validator.ValidateErrorArgs e) |
|
49 |
{ |
|
50 |
e.Received = false; |
|
51 |
} |
|
52 |
|
|
53 |
private void database_Click(object sender, RoutedEventArgs e) |
|
54 |
{ |
|
55 |
for (int i = 0; i < 10; i++) |
|
56 |
{ |
|
57 |
DispatcherTimer timer = new DispatcherTimer(); |
|
58 |
timer.Interval = new TimeSpan(0, 0, 0, 0, 50); |
|
59 |
timer.Tick += (snd, evt) => |
|
60 |
{ |
|
61 |
License.DB.DataBase db = new License.DB.DataBase(); |
|
62 |
db.Active($"Timer {(snd as DispatcherTimer).Tag.ToString()}{Guid.NewGuid().ToString()}", Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); |
|
63 |
}; |
|
64 |
|
|
65 |
timer.Tag = i.ToString(); |
|
66 |
timer.Start(); |
|
67 |
} |
|
68 |
|
|
69 |
} |
|
70 |
|
|
71 |
private void license_Click(object sender, RoutedEventArgs e) |
|
72 |
{ |
|
73 |
for (int i = 0; i < 10; i++) |
|
74 |
{ |
|
75 |
DispatcherTimer timer = new DispatcherTimer(); |
|
76 |
timer.Interval = new TimeSpan(0, 0, 0, 0, 50); |
|
77 |
timer.Tick += (snd, evt) => |
|
78 |
{ |
|
79 |
var license = new License.Validator.Valid("http://localhost:51087"); |
|
80 |
//var license = new License.Validator.Valid("http://192.168.0.67:8921"); |
|
81 |
|
|
82 |
license.GetLicense("public.xml"); |
|
83 |
|
|
84 |
if (license.Activate()) |
|
85 |
{ |
|
86 |
System.Diagnostics.Debug.WriteLine($"Timer:{(snd as DispatcherTimer).Tag.ToString()} Active : {license.Name}"); |
|
87 |
} |
|
88 |
}; |
|
89 |
|
|
90 |
timer.Tag = i.ToString(); |
|
91 |
timer.Start(); |
|
92 |
} |
|
93 |
} |
|
27 | 94 |
} |
28 | 95 |
} |
내보내기 Unified diff