|
@@ -9,12 +9,15 @@ using Xamarin.Essentials;
|
|
|
using Xamarin.Forms;
|
|
|
using Xamarin.Forms.Xaml;
|
|
|
using System.Net;
|
|
|
+using InABox.Core;
|
|
|
|
|
|
namespace ConnectionTest
|
|
|
{
|
|
|
+ public delegate void RemoveURL(View view);
|
|
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
|
|
public partial class ConnectionTestUnit : ContentView
|
|
|
{
|
|
|
+ public event RemoveURL OnRemoveURL;
|
|
|
string URL = "";
|
|
|
string log = "";
|
|
|
public ConnectionTestUnit(string url)
|
|
@@ -24,7 +27,7 @@ namespace ConnectionTest
|
|
|
urlLbl.Text = URL;
|
|
|
Task.Run(() =>
|
|
|
{
|
|
|
- Thread.Sleep(500);
|
|
|
+ Thread.Sleep(3000);
|
|
|
StartTest();
|
|
|
});
|
|
|
Resolve();
|
|
@@ -96,13 +99,14 @@ namespace ConnectionTest
|
|
|
{
|
|
|
int count = 1;
|
|
|
int crashcount = 0;
|
|
|
- ClientFactory.SetClientType(typeof(JsonClient<>), "Test app", "1.0", URL, true);
|
|
|
while (true)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
Thread.Sleep(500);
|
|
|
- var result = ClientFactory.Validate("TAN", "nictan");
|
|
|
+ var client = new JsonClient<User>(URL);
|
|
|
+ var result = client.Validate("TAN", "nictan", Guid.Empty);
|
|
|
+
|
|
|
Device.BeginInvokeOnMainThread(() =>
|
|
|
{
|
|
|
attemptNoLbl.Text = "Attempt: " + count;
|
|
@@ -121,5 +125,10 @@ namespace ConnectionTest
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void CloseButton_Clicked(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ OnRemoveURL?.Invoke(this);
|
|
|
+ }
|
|
|
}
|
|
|
}
|