diff --git a/Borepin/Borepin/App.xaml.cs b/Borepin/Borepin/App.xaml.cs
index 4fc87c3..76e7c3e 100644
--- a/Borepin/Borepin/App.xaml.cs
+++ b/Borepin/Borepin/App.xaml.cs
@@ -10,7 +10,6 @@ using Borepin.PageModel.SetUpProcess;
using Borepin.Page.AddServerProcess;
using Borepin.PageModel.AddServerProcess;
using System;
-using Prism.Navigation;
using Borepin.Service.Storage;
namespace Borepin
diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj
index 97ed6e0..0307902 100644
--- a/Borepin/Borepin/Borepin.csproj
+++ b/Borepin/Borepin/Borepin.csproj
@@ -21,8 +21,11 @@
+
+
+
@@ -32,7 +35,6 @@
-
diff --git a/Borepin/Borepin/Helpers/TranslateExtension.cs b/Borepin/Borepin/Helpers/TranslateExtension.cs
deleted file mode 100644
index 77139d0..0000000
--- a/Borepin/Borepin/Helpers/TranslateExtension.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using Plugin.Multilingual;
-using System;
-using System.Reflection;
-using System.Resources;
-using Xamarin.Forms;
-using Xamarin.Forms.Xaml;
-
-namespace Borepin.Helpers
-{
- [ContentProperty("Text")]
- public class TranslateExtension : IMarkupExtension
- {
- const string _ResourceId = "Borepin.Resources.Text.TextResource";
-
- static readonly Lazy _Resmgr = new Lazy(() => new ResourceManager(_ResourceId, typeof(TranslateExtension).GetTypeInfo().Assembly));
-
- public string Text { get; set; }
-
- public object ProvideValue(IServiceProvider serviceProvider)
- {
- if (Text == null)
- {
- return "";
- }
-
- System.Globalization.CultureInfo ci = CrossMultilingual.Current.CurrentCultureInfo;
-
- string translation = _Resmgr.Value.GetString(Text, ci);
-
- if (translation == null)
- {
-
-#if DEBUG
- //throw new ArgumentException(
- // String.Format("Key '{0}' was not found in resources '{1}' for culture '{2}'.", Text, ResourceId, ci.Name),
- // "Text");
- translation = "!MISSING TEXT!";
-#else
- translation = Text; // returns the key, which GETS DISPLAYED TO THE USER
-#endif
- }
- return translation;
- }
- }
-}
diff --git a/Borepin/Borepin/MultilingualResources/Borepin.de.xlf b/Borepin/Borepin/MultilingualResources/Borepin.de.xlf
deleted file mode 100644
index ee215de..0000000
--- a/Borepin/Borepin/MultilingualResources/Borepin.de.xlf
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Automate your Space with FabAccess
- Automate your Space with FabAccess
-
-
- Welcome
- Welcome
-
-
- Begin working
- Begin working
-
-
- Login to your Space
- Login to your Space
-
-
- Wenn du dieses Logo siehst, dann kannst du es scannen
- Wenn du dieses Logo siehst, dann kannst du es scannen
-
-
-
-
-
\ No newline at end of file
diff --git a/Borepin/Borepin/MultilingualResources/Borepin.en.xlf b/Borepin/Borepin/MultilingualResources/Borepin.en.xlf
deleted file mode 100644
index ae8fdc1..0000000
--- a/Borepin/Borepin/MultilingualResources/Borepin.en.xlf
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Automate your Space with FabAccess
- Automate your Space with FabAccess
-
-
- Welcome
- Welcome
-
-
- Begin working
- Begin working
-
-
- Login to your Space
- Login to your Space
-
-
- Wenn du dieses Logo siehst, dann kannst du es scannen
- Wenn du dieses Logo siehst, dann kannst du es scannen
-
-
-
-
-
\ No newline at end of file
diff --git a/Borepin/Borepin/Page/AddServerProcess/SelectServerPage.xaml b/Borepin/Borepin/Page/AddServerProcess/SelectServerPage.xaml
index ed588ac..fef59c0 100644
--- a/Borepin/Borepin/Page/AddServerProcess/SelectServerPage.xaml
+++ b/Borepin/Borepin/Page/AddServerProcess/SelectServerPage.xaml
@@ -16,7 +16,7 @@
-
+
diff --git a/Borepin/Borepin/Page/SetUpProcess/WelcomePage.xaml b/Borepin/Borepin/Page/SetUpProcess/WelcomePage.xaml
index d414ae0..ce2cb25 100644
--- a/Borepin/Borepin/Page/SetUpProcess/WelcomePage.xaml
+++ b/Borepin/Borepin/Page/SetUpProcess/WelcomePage.xaml
@@ -2,14 +2,14 @@
-
-
-
+
+
+
diff --git a/Borepin/Borepin/PageModel/AddServerProcess/AuthPlainPageModel.cs b/Borepin/Borepin/PageModel/AddServerProcess/AuthPlainPageModel.cs
index 3d28024..ab682c6 100644
--- a/Borepin/Borepin/PageModel/AddServerProcess/AuthPlainPageModel.cs
+++ b/Borepin/Borepin/PageModel/AddServerProcess/AuthPlainPageModel.cs
@@ -5,11 +5,13 @@ using System.Windows.Input;
using Borepin.Base;
using Borepin.Base.Exceptions;
using Borepin.Service;
+using Borepin.Service.Storage;
using FabAccessAPI;
using FabAccessAPI.Exceptions;
using Prism.Commands;
using Prism.Navigation;
using Prism.Services;
+using Xamarin.Forms;
namespace Borepin.PageModel.AddServerProcess
{
@@ -17,11 +19,14 @@ namespace Borepin.PageModel.AddServerProcess
{
#region Private Fields
private ConnectionData _ConnectionData;
+ private readonly ILoginStorageService _LoginStorageService;
#endregion
#region Constructors
- public AuthPlainPageModel(INavigationService navigationService, IAPIService apiService, IPageDialogService pageDialogService) : base(navigationService, pageDialogService, apiService)
+ public AuthPlainPageModel(INavigationService navigationService, IAPIService apiService, IPageDialogService pageDialogService, ILoginStorageService loginStorageService) : base(navigationService, pageDialogService, apiService)
{
+ _LoginStorageService = loginStorageService;
+
AuthenticateCommand = new DelegateCommand(async () => await AuthenticateCommandExecute().ConfigureAwait(false));
}
#endregion
@@ -77,19 +82,19 @@ namespace Borepin.PageModel.AddServerProcess
Username = Username,
Properties = new Dictionary(StringComparer.Ordinal)
{
- { "username", Username },
- { "password", Password },
+ { "Username", Username },
+ { "Password", Password },
},
};
if (_API.IsConnected)
{
- await _API.Disconnect().ConfigureAwait(true);
+ await _API.Disconnect().ConfigureAwait(false);
}
try
{
- await _API.Connect(_ConnectionData).ConfigureAwait(true);
+ await _API.Connect(_ConnectionData).ConfigureAwait(false);
}
catch (ConnectingFailedException)
{
@@ -113,11 +118,17 @@ namespace Borepin.PageModel.AddServerProcess
return;
}
- INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage").ConfigureAwait(false);
- if(result.Exception != null)
+ await _LoginStorageService.Add(_ConnectionData).ConfigureAwait(false);
+ await _LoginStorageService.UpdateTimestamp(_ConnectionData).ConfigureAwait(false);
+
+ Device.BeginInvokeOnMainThread(async () =>
{
- Log.Fatal(result.Exception, "Navigating failed");
- }
+ INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage").ConfigureAwait(false);
+ if (result.Exception != null)
+ {
+ Log.Fatal(result.Exception, "Navigating failed");
+ }
+ });
}
#endregion
}
diff --git a/Borepin/Borepin/PageModel/AddServerProcess/SelectServerPageModel.cs b/Borepin/Borepin/PageModel/AddServerProcess/SelectServerPageModel.cs
index ba73052..b4fb613 100644
--- a/Borepin/Borepin/PageModel/AddServerProcess/SelectServerPageModel.cs
+++ b/Borepin/Borepin/PageModel/AddServerProcess/SelectServerPageModel.cs
@@ -1,5 +1,4 @@
using Borepin.Base;
-using Borepin.Service;
using FabAccessAPI;
using FabAccessAPI.Exceptions;
using Prism.Commands;
diff --git a/Borepin/Borepin/PageModel/MachineListPageModel.cs b/Borepin/Borepin/PageModel/MachineListPageModel.cs
index c4663a7..ea71b41 100644
--- a/Borepin/Borepin/PageModel/MachineListPageModel.cs
+++ b/Borepin/Borepin/PageModel/MachineListPageModel.cs
@@ -107,7 +107,7 @@ namespace Borepin.PageModel
NavigationParameters parameters = new NavigationParameters
{
- { "id", viewmodel.Instance.Id },
+ { "instance", viewmodel.Instance.Id },
};
await _NavigationService.NavigateAsync($"MachinePage", parameters).ConfigureAwait(false);
diff --git a/Borepin/Borepin/PageModel/ServerListPageModel.cs b/Borepin/Borepin/PageModel/ServerListPageModel.cs
index 9e6959c..facc9c3 100644
--- a/Borepin/Borepin/PageModel/ServerListPageModel.cs
+++ b/Borepin/Borepin/PageModel/ServerListPageModel.cs
@@ -31,8 +31,8 @@ namespace Borepin.PageModel
}
#endregion
- #region Data
- public async Task LoadData()
+ #region LoadData
+ public override async Task LoadInstance(object instance)
{
IList list = await _LoginStorageService.GetList().ConfigureAwait(false);
if (_API.IsConnected)
diff --git a/Borepin/Borepin/PageModel/ServerPageModel.cs b/Borepin/Borepin/PageModel/ServerPageModel.cs
index 4349251..6d670b5 100644
--- a/Borepin/Borepin/PageModel/ServerPageModel.cs
+++ b/Borepin/Borepin/PageModel/ServerPageModel.cs
@@ -12,6 +12,7 @@ using System;
using System.Globalization;
using System.Threading.Tasks;
using System.Windows.Input;
+using Xamarin.Forms;
namespace Borepin.PageModel
{
@@ -123,11 +124,16 @@ namespace Borepin.PageModel
return;
}
- INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage").ConfigureAwait(false);
- if(result.Exception != null)
+ await _LoginStorageService.UpdateTimestamp(_Connection_Item).ConfigureAwait(false);
+
+ Device.BeginInvokeOnMainThread(async () =>
{
- Log.Fatal(result.Exception, "Navigating failed");
- }
+ INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage").ConfigureAwait(false);
+ if (result.Exception != null)
+ {
+ Log.Fatal(result.Exception, "Navigating failed");
+ }
+ });
}
private ICommand _DisconnectCommand;
diff --git a/Borepin/Borepin/PageModel/StartPageModel.cs b/Borepin/Borepin/PageModel/StartPageModel.cs
index 8c07818..4b8cd7c 100644
--- a/Borepin/Borepin/PageModel/StartPageModel.cs
+++ b/Borepin/Borepin/PageModel/StartPageModel.cs
@@ -5,6 +5,7 @@ using Prism.AppModel;
using Prism.Navigation;
using Prism.Services;
using System.Collections.Generic;
+using Xamarin.Forms;
namespace Borepin.PageModel
{
@@ -27,19 +28,25 @@ namespace Borepin.PageModel
IList connectionData_List = await _LoginStorageService.GetList().ConfigureAwait(false);
if (connectionData_List.Count == 0)
{
- INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/SetUpProcess_WelcomePage").ConfigureAwait(false);
- if (result.Exception != null)
+ Device.BeginInvokeOnMainThread(async () =>
{
- Log.Fatal(result.Exception, "Navigating failed");
- }
+ INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/SetUpProcess_WelcomePage").ConfigureAwait(false);
+ if (result.Exception != null)
+ {
+ Log.Fatal(result.Exception, "Navigating failed");
+ }
+ });
}
else
{
- INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/ServerListPage").ConfigureAwait(false);
- if (result.Exception != null)
+ Device.BeginInvokeOnMainThread(async () =>
{
- Log.Fatal(result.Exception, "Navigating failed");
- }
+ INavigationResult result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/ServerListPage").ConfigureAwait(false);
+ if (result.Exception != null)
+ {
+ Log.Fatal(result.Exception, "Navigating failed");
+ }
+ });
}
}
diff --git a/Borepin/Borepin/Resources/Text/TextResource.Designer.cs b/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
index 702a60f..d608b3e 100644
--- a/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
+++ b/Borepin/Borepin/Resources/Text/TextResource.Designer.cs
@@ -10,35 +10,48 @@
namespace Borepin.Resources.Text {
using System;
- using System.Reflection;
- [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class TextResource {
- private static System.Resources.ResourceManager resourceMan;
+ private static global::System.Resources.ResourceManager resourceMan;
- private static System.Globalization.CultureInfo resourceCulture;
+ private static global::System.Globalization.CultureInfo resourceCulture;
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal TextResource() {
}
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static System.Resources.ResourceManager ResourceManager {
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
get {
- if (object.Equals(null, resourceMan)) {
- System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Borepin.Resources.Text.TextResource", typeof(TextResource).Assembly);
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Borepin.Resources.Text.TextResource", typeof(TextResource).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static System.Globalization.CultureInfo Culture {
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
@@ -47,30 +60,36 @@ namespace Borepin.Resources.Text {
}
}
+ ///
+ /// Looks up a localized string similar to Login to your Space.
+ ///
internal static string SetUp_ScanPage_Button {
get {
return ResourceManager.GetString("SetUp_ScanPage_Button", resourceCulture);
}
}
- internal static string SetUp_ScanPage_Text {
- get {
- return ResourceManager.GetString("SetUp_ScanPage_Text", resourceCulture);
- }
- }
-
+ ///
+ /// Looks up a localized string similar to Begin working.
+ ///
internal static string SetUp_WelcomePage_Button {
get {
return ResourceManager.GetString("SetUp_WelcomePage_Button", resourceCulture);
}
}
+ ///
+ /// Looks up a localized string similar to Automate your Space with FabAccess.
+ ///
internal static string SetUp_WelcomePage_Text {
get {
return ResourceManager.GetString("SetUp_WelcomePage_Text", resourceCulture);
}
}
+ ///
+ /// Looks up a localized string similar to Welcome.
+ ///
internal static string SetUp_WelcomePage_Title {
get {
return ResourceManager.GetString("SetUp_WelcomePage_Title", resourceCulture);
diff --git a/Borepin/Borepin/Resources/Text/TextResource.en.resx b/Borepin/Borepin/Resources/Text/TextResource.en.resx
deleted file mode 100644
index a3df4f0..0000000
--- a/Borepin/Borepin/Resources/Text/TextResource.en.resx
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/Borepin/Borepin/Resources/Text/TextResource.resx b/Borepin/Borepin/Resources/Text/TextResource.resx
index 63638c2..43adaa9 100644
--- a/Borepin/Borepin/Resources/Text/TextResource.resx
+++ b/Borepin/Borepin/Resources/Text/TextResource.resx
@@ -120,9 +120,6 @@
Login to your Space
-
- Wenn du dieses Logo siehst, dann kannst du es scannen
-
Begin working
diff --git a/Borepin/Borepin/Service/Storage/LoginStorageService.cs b/Borepin/Borepin/Service/Storage/LoginStorageService.cs
index dd94775..c9a6b75 100644
--- a/Borepin/Borepin/Service/Storage/LoginStorageService.cs
+++ b/Borepin/Borepin/Service/Storage/LoginStorageService.cs
@@ -4,6 +4,7 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using System.Linq;
namespace Borepin.Service.Storage
{
@@ -53,13 +54,13 @@ namespace Borepin.Service.Storage
throw new InvalidConnectionExceptoin(connectionData);
}
- IList connectionData_List = await _LoadConnectionData().ConfigureAwait(false);
+ List connectionData_List = new List(await _LoadConnectionData().ConfigureAwait(false));
if (connectionData_List.Contains(connectionData))
{
throw new MissingConnectionException(connectionData);
}
- connectionData_List.Remove(connectionData);
+ connectionData_List.RemoveAll(x => x.Equals(connectionData));
await _SaveConnectionData(connectionData_List).ConfigureAwait(false);
}
@@ -70,7 +71,7 @@ namespace Borepin.Service.Storage
throw new InvalidConnectionExceptoin(connectionData);
}
- IList connectionData_List = await _LoadConnectionData().ConfigureAwait(false);
+ List connectionData_List = new List(await _LoadConnectionData().ConfigureAwait(false));
if (connectionData_List.Contains(connectionData))
{
throw new MissingConnectionException(connectionData);
@@ -78,7 +79,7 @@ namespace Borepin.Service.Storage
connectionData.LastTime = DateTime.UtcNow;
- connectionData_List.Remove(connectionData);
+ connectionData_List.RemoveAll(x => x.Equals(connectionData));
connectionData_List.Add(connectionData);
await _SaveConnectionData(connectionData_List).ConfigureAwait(false);
}
@@ -91,7 +92,15 @@ namespace Borepin.Service.Storage
try
{
string data = await _SecretStorageService.GetAsync(StorageKey).ConfigureAwait(false);
- connectionData_List = JsonConvert.DeserializeObject>(data);
+ if(data != null)
+ {
+ connectionData_List = JsonConvert.DeserializeObject>(data);
+ }
+ else
+ {
+ connectionData_List = new List();
+ await _SecretStorageService.SetAsync(StorageKey, JsonConvert.SerializeObject(connectionData_List)).ConfigureAwait(false);
+ }
}
catch (JsonSerializationException)
{
diff --git a/FabAccessAPI/ConnectionData.cs b/FabAccessAPI/ConnectionData.cs
index a78ba38..2fd22d4 100644
--- a/FabAccessAPI/ConnectionData.cs
+++ b/FabAccessAPI/ConnectionData.cs
@@ -13,11 +13,17 @@ namespace FabAccessAPI
public override bool Equals(object? obj)
{
- return obj is ConnectionData data &&
- EqualityComparer.Default.Equals(Host, data.Host) &&
- Mechanism == data.Mechanism &&
- Username == data.Username &&
- EqualityComparer>.Default.Equals(Properties, data.Properties);
+ if(obj is ConnectionData && obj != null)
+ {
+ ConnectionData? data = obj as ConnectionData;
+ return data.Host.Host == Host.Host &&
+ data.Host.Port == Host.Port &&
+ data.Mechanism == Mechanism &&
+ data.Username == Username &&
+ EqualityComparer>.Default.Equals(Properties, data.Properties);
+
+ }
+ return false;
}
public override int GetHashCode()