diff --git a/Borepin/Borepin.Android/Borepin.Android.csproj b/Borepin/Borepin.Android/Borepin.Android.csproj
index faed791..a6f3713 100644
--- a/Borepin/Borepin.Android/Borepin.Android.csproj
+++ b/Borepin/Borepin.Android/Borepin.Android.csproj
@@ -1,4 +1,4 @@
-
+
Debug
@@ -78,6 +78,7 @@
+
@@ -188,4 +189,4 @@
-
+
\ No newline at end of file
diff --git a/Borepin/Borepin.Android/PlatformInitializer.cs b/Borepin/Borepin.Android/PlatformInitializer.cs
index 3ef5cd9..7d8bdc6 100644
--- a/Borepin/Borepin.Android/PlatformInitializer.cs
+++ b/Borepin/Borepin.Android/PlatformInitializer.cs
@@ -1,5 +1,6 @@
using Borepin.Droid.Services;
using Borepin.Service.Storage;
+using Borepin.Service.Versioning;
using Prism;
using Prism.Ioc;
@@ -11,6 +12,7 @@ namespace Borepin.Droid
{
containerRegistry.Register();
containerRegistry.Register();
+ containerRegistry.Register();
}
}
}
\ No newline at end of file
diff --git a/Borepin/Borepin.Android/Services/VersioningService.cs b/Borepin/Borepin.Android/Services/VersioningService.cs
new file mode 100644
index 0000000..17f2262
--- /dev/null
+++ b/Borepin/Borepin.Android/Services/VersioningService.cs
@@ -0,0 +1,30 @@
+using Borepin.Service.Versioning;
+using Xamarin.Essentials;
+
+namespace Borepin.Droid.Services
+{
+ public class VersioningService : IVersioningService
+ {
+ #region Constructors
+ public VersioningService()
+ {
+ VersionTracking.Track();
+ }
+ #endregion
+ public string CurrentBuild
+ {
+ get
+ {
+ return VersionTracking.CurrentBuild;
+ }
+ }
+
+ public string CurrentVersion
+ {
+ get
+ {
+ return VersionTracking.CurrentVersion;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Borepin/Borepin.UWP/Borepin.UWP.csproj b/Borepin/Borepin.UWP/Borepin.UWP.csproj
index ee66686..e344410 100644
--- a/Borepin/Borepin.UWP/Borepin.UWP.csproj
+++ b/Borepin/Borepin.UWP/Borepin.UWP.csproj
@@ -100,6 +100,7 @@
+
diff --git a/Borepin/Borepin.UWP/PlatformInitializer.cs b/Borepin/Borepin.UWP/PlatformInitializer.cs
index f82af1b..08027a6 100644
--- a/Borepin/Borepin.UWP/PlatformInitializer.cs
+++ b/Borepin/Borepin.UWP/PlatformInitializer.cs
@@ -2,6 +2,7 @@
using Prism;
using Prism.Ioc;
using Borepin.Service.Storage;
+using Borepin.Service.Versioning;
namespace Borepin.UWP
{
@@ -11,6 +12,7 @@ namespace Borepin.UWP
{
containerRegistry.Register();
containerRegistry.Register();
+ containerRegistry.Register();
}
}
}
diff --git a/Borepin/Borepin.UWP/Services/VersioningService.cs b/Borepin/Borepin.UWP/Services/VersioningService.cs
new file mode 100644
index 0000000..1205e72
--- /dev/null
+++ b/Borepin/Borepin.UWP/Services/VersioningService.cs
@@ -0,0 +1,30 @@
+using Borepin.Service.Versioning;
+using Xamarin.Essentials;
+
+namespace Borepin.UWP.Services
+{
+ public class VersioningService : IVersioningService
+ {
+ #region Constructors
+ public VersioningService()
+ {
+ VersionTracking.Track();
+ }
+ #endregion
+ public string CurrentBuild
+ {
+ get
+ {
+ return VersionTracking.CurrentBuild;
+ }
+ }
+
+ public string CurrentVersion
+ {
+ get
+ {
+ return VersionTracking.CurrentVersion;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Borepin/Borepin.iOS/Borepin.iOS.csproj b/Borepin/Borepin.iOS/Borepin.iOS.csproj
index 5761e94..034aecc 100644
--- a/Borepin/Borepin.iOS/Borepin.iOS.csproj
+++ b/Borepin/Borepin.iOS/Borepin.iOS.csproj
@@ -1,4 +1,4 @@
-
+
true
@@ -52,11 +52,13 @@
ARM64
true
Entitlements.plist
- SdkOnly
- -all
+ None
+
+
--optimize=experimental-xforms-product-type
iPhone Developer
+ false
none
@@ -69,6 +71,9 @@
--optimize=experimental-xforms-product-type
SdkOnly
iPhone Distribution
+
+ false
+ -all
@@ -78,6 +83,7 @@
+
@@ -198,4 +204,4 @@
-
+
\ No newline at end of file
diff --git a/Borepin/Borepin.iOS/PlatformInitializer.cs b/Borepin/Borepin.iOS/PlatformInitializer.cs
index 21dfdbc..ff22291 100644
--- a/Borepin/Borepin.iOS/PlatformInitializer.cs
+++ b/Borepin/Borepin.iOS/PlatformInitializer.cs
@@ -1,5 +1,6 @@
using Borepin.iOS.Services;
using Borepin.Service.Storage;
+using Borepin.Service.Versioning;
using Prism;
using Prism.Ioc;
@@ -11,6 +12,7 @@ namespace Borepin.iOS
{
containerRegistry.Register();
containerRegistry.Register();
+ containerRegistry.Register();
}
}
}
\ No newline at end of file
diff --git a/Borepin/Borepin.iOS/Services/VersioningService.cs b/Borepin/Borepin.iOS/Services/VersioningService.cs
new file mode 100644
index 0000000..38411e1
--- /dev/null
+++ b/Borepin/Borepin.iOS/Services/VersioningService.cs
@@ -0,0 +1,30 @@
+using Borepin.Service.Versioning;
+using Xamarin.Essentials;
+
+namespace Borepin.iOS.Services
+{
+ public class VersioningService : IVersioningService
+ {
+ #region Constructors
+ public VersioningService()
+ {
+ VersionTracking.Track();
+ }
+ #endregion
+ public string CurrentBuild
+ {
+ get
+ {
+ return VersionTracking.CurrentBuild;
+ }
+ }
+
+ public string CurrentVersion
+ {
+ get
+ {
+ return VersionTracking.CurrentVersion;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj
index 6e8e1a7..176986f 100644
--- a/Borepin/Borepin/Borepin.csproj
+++ b/Borepin/Borepin/Borepin.csproj
@@ -29,6 +29,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Borepin/Borepin/Converter/ListNotEmptyConverter.cs b/Borepin/Borepin/Converter/ListNotEmptyConverter.cs
new file mode 100644
index 0000000..dc48d65
--- /dev/null
+++ b/Borepin/Borepin/Converter/ListNotEmptyConverter.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections;
+using System.Globalization;
+using Xamarin.Forms;
+
+namespace Borepin.Converter
+{
+ public class ListNotEmptyConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if(value != null && value is IList)
+ {
+ ICollection collection = value as ICollection;
+ return collection.Count > 0;
+ }
+ return false;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotSupportedException();
+ }
+ }
+}
diff --git a/Borepin/Borepin/Dialog/ConfirmDialog.xaml b/Borepin/Borepin/Dialog/ConfirmDialog.xaml
index 116e979..aedfd2e 100644
--- a/Borepin/Borepin/Dialog/ConfirmDialog.xaml
+++ b/Borepin/Borepin/Dialog/ConfirmDialog.xaml
@@ -4,11 +4,11 @@
x:Class="Borepin.Dialog.ConfirmDialog"
BackgroundColor="White">
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/Borepin/Borepin/Page/AddServerProcess/AuthPlainPage.xaml b/Borepin/Borepin/Page/AddServerProcess/AuthPlainPage.xaml
index f014ab3..9c4b58a 100644
--- a/Borepin/Borepin/Page/AddServerProcess/AuthPlainPage.xaml
+++ b/Borepin/Borepin/Page/AddServerProcess/AuthPlainPage.xaml
@@ -16,7 +16,7 @@
-
+
diff --git a/Borepin/Borepin/Page/AddServerProcess/SelectServerPage.xaml b/Borepin/Borepin/Page/AddServerProcess/SelectServerPage.xaml
index d80b2c5..ed588ac 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/MainPage.xaml b/Borepin/Borepin/Page/MainPage.xaml
index b39d289..539e2f5 100644
--- a/Borepin/Borepin/Page/MainPage.xaml
+++ b/Borepin/Borepin/Page/MainPage.xaml
@@ -4,10 +4,16 @@
x:Class="Borepin.Page.MainPage"
Title="MainPage">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/Borepin/Borepin/Page/ServerListPage.xaml b/Borepin/Borepin/Page/ServerListPage.xaml
index 308412d..5b59f46 100644
--- a/Borepin/Borepin/Page/ServerListPage.xaml
+++ b/Borepin/Borepin/Page/ServerListPage.xaml
@@ -8,6 +8,7 @@
+
@@ -15,28 +16,22 @@
-
+
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Borepin/Borepin/Page/ServerPage.xaml b/Borepin/Borepin/Page/ServerPage.xaml
index c2e5464..c2ce4f1 100644
--- a/Borepin/Borepin/Page/ServerPage.xaml
+++ b/Borepin/Borepin/Page/ServerPage.xaml
@@ -14,12 +14,19 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Borepin/Borepin/PageModel/MachineListPageModel.cs b/Borepin/Borepin/PageModel/MachineListPageModel.cs
index ce0a36a..13ff559 100644
--- a/Borepin/Borepin/PageModel/MachineListPageModel.cs
+++ b/Borepin/Borepin/PageModel/MachineListPageModel.cs
@@ -10,6 +10,10 @@ using FabAccessAPI.Schema;
using Prism.Services.Dialogs;
using Prism.Services;
using Prism.AppModel;
+using static FabAccessAPI.Schema.Machine;
+using System;
+using NaturalSort.Extension;
+using System.Linq;
namespace Borepin.PageModel
{
@@ -45,19 +49,37 @@ namespace Borepin.PageModel
IsConnected = true;
- IMachineSystem machineInterface = await _BFFHService.GetMachineSystemInterface().ConfigureAwait(false);
+ IMachineSystem machineSystem = await _BFFHService.GetMachineSystemInterface().ConfigureAwait(false);
+ MachineSystem.IInfoInterface machine_infoInterface = await machineSystem.Info().ConfigureAwait(false);
- MachineSystem.IInfoInterface infoInterface = await machineInterface.Info().ConfigureAwait(false);
+ IUserSystem userSystem = await _BFFHService.GetUserSystemInterface().ConfigureAwait(false);
+ UserSystem.IInfoInterface user_infoInterface = await userSystem.Info().ConfigureAwait(false);
+ User user_self = (await user_infoInterface.GetUserSelf().ConfigureAwait(false)).Item1;
- IReadOnlyList machine_list = await infoInterface.GetMachineList().ConfigureAwait(false);
+ IReadOnlyList machine_list = await machine_infoInterface.GetMachineList().ConfigureAwait(false);
- List viewmodel_list = new List();
+ List viewmodel_list_user_assigned = new List();
+ List viewmodel_list_not_user_assigned = new List();
foreach (Machine machine in machine_list)
{
- viewmodel_list.Add(new MachineListItemViewModel(machine));
+ if(!((InUseInterface_Proxy)machine.Inuse).IsNull)
+ {
+ MachineListItemViewModel new_viewmodel = new MachineListItemViewModel(machine)
+ {
+ IsUserAssigned = true
+ };
+ viewmodel_list_user_assigned.Add(new_viewmodel);
+ }
+ else
+ {
+ viewmodel_list_not_user_assigned.Add(new MachineListItemViewModel(machine));
+ }
}
- MachineListItemViewModel_List = viewmodel_list;
+ List viewmodel_list_sorted = new List();
+ viewmodel_list_sorted.AddRange(viewmodel_list_user_assigned.OrderBy(x => x.Name, StringComparison.OrdinalIgnoreCase.WithNaturalSort()));
+ viewmodel_list_sorted.AddRange(viewmodel_list_not_user_assigned.OrderBy(x => x.Name, StringComparison.OrdinalIgnoreCase.WithNaturalSort()));
+ MachineListItemViewModel_List = viewmodel_list_sorted;
IsBusy = false;
}
@@ -181,6 +203,7 @@ namespace Borepin.PageModel
public override async void OnNavigatedTo(INavigationParameters parameters)
{
+ IsBusy = true;
await LoadData().ConfigureAwait(false);
}
#endregion
diff --git a/Borepin/Borepin/PageModel/MainPageModel.cs b/Borepin/Borepin/PageModel/MainPageModel.cs
index f05e43e..36afcd8 100644
--- a/Borepin/Borepin/PageModel/MainPageModel.cs
+++ b/Borepin/Borepin/PageModel/MainPageModel.cs
@@ -2,6 +2,7 @@
using System.Threading.Tasks;
using System.Windows.Input;
using Borepin.Base;
+using Borepin.Service.Versioning;
using Prism.Navigation;
using Xamarin.Forms;
@@ -9,9 +10,15 @@ namespace Borepin.PageModel
{
public class MainPageModel : PageModelBase
{
+ #region Private Members
+ private readonly IVersioningService _VersioningService;
+ #endregion
+
#region Constructors
- public MainPageModel(INavigationService navigationService) : base(navigationService)
+ public MainPageModel(INavigationService navigationService, IVersioningService versioningService) : base(navigationService)
{
+ _VersioningService = versioningService;
+
NavigateCommand = new Command(NavigateCommandExecute);
}
#endregion
@@ -19,10 +26,29 @@ namespace Borepin.PageModel
#region LoadData
public override Task LoadData()
{
+ CurrentVersion = _VersioningService.CurrentVersion;
+ CurrentBuild = _VersioningService.CurrentBuild;
+
return Task.CompletedTask;
}
#endregion
+ #region Fields
+ private string _CurrentVersion;
+ public string CurrentVersion
+ {
+ get => _CurrentVersion;
+ set => SetProperty(ref _CurrentVersion, value);
+ }
+
+ private string _CurrentBuild;
+ public string CurrentBuild
+ {
+ get => _CurrentBuild;
+ set => SetProperty(ref _CurrentBuild, value);
+ }
+ #endregion
+
#region Commands
private ICommand _NavigationCommand;
public ICommand NavigateCommand
@@ -42,9 +68,9 @@ namespace Borepin.PageModel
}
- public override void OnNavigatedTo(INavigationParameters parameters)
+ public override async void OnNavigatedTo(INavigationParameters parameters)
{
-
+ await LoadData().ConfigureAwait(false);
}
#endregion
}
diff --git a/Borepin/Borepin/PageModel/ServerListPageModel.cs b/Borepin/Borepin/PageModel/ServerListPageModel.cs
index dedd08c..286f27b 100644
--- a/Borepin/Borepin/PageModel/ServerListPageModel.cs
+++ b/Borepin/Borepin/PageModel/ServerListPageModel.cs
@@ -8,7 +8,6 @@ using Prism.Commands;
using Prism.Navigation;
using Borepin.Service.BFFH;
using Borepin.Base;
-using System;
namespace Borepin.PageModel
{
@@ -34,10 +33,7 @@ namespace Borepin.PageModel
IList list = await _BFFHService.GetConnections().ConfigureAwait(false);
if (_BFFHService.IsConnected)
{
- ActiveConnection = new List
- {
- new ServerListItemViewModel(_BFFHService.CurrentConnection),
- };
+ ActiveConnection = new ServerListItemViewModel(_BFFHService.CurrentConnection);
list.Remove(_BFFHService.CurrentConnection);
@@ -62,8 +58,8 @@ namespace Borepin.PageModel
set => SetProperty(ref _ServerListItemViewModel_List, value);
}
- private IList _ActiveConnection;
- public IList ActiveConnection
+ private ServerListItemViewModel _ActiveConnection;
+ public ServerListItemViewModel ActiveConnection
{
get => _ActiveConnection;
set => SetProperty(ref _ActiveConnection, value);
diff --git a/Borepin/Borepin/PageModel/ServerPageModel.cs b/Borepin/Borepin/PageModel/ServerPageModel.cs
index f2f18eb..04ad232 100644
--- a/Borepin/Borepin/PageModel/ServerPageModel.cs
+++ b/Borepin/Borepin/PageModel/ServerPageModel.cs
@@ -7,6 +7,7 @@ using Prism.Navigation;
using Prism.Services;
using Prism.Services.Dialogs;
using System;
+using System.Globalization;
using System.Threading.Tasks;
using System.Windows.Input;
@@ -46,6 +47,11 @@ namespace Borepin.PageModel
InstanceIsActiveConnection = false;
}
+ if(_Connection_Item != null && _Connection_Item.Address != null)
+ {
+ DisplayAddress = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", _Connection_Item.Address.Host, _Connection_Item.Address.Port);
+ }
+
IsBusy = false;
return Task.CompletedTask;
}
@@ -59,6 +65,13 @@ namespace Borepin.PageModel
set => SetProperty(ref _Connection_Item, value);
}
+ private string _DisplayAddress;
+ public string DisplayAddress
+ {
+ get => _DisplayAddress;
+ set => SetProperty(ref _DisplayAddress, value);
+ }
+
private bool _InstanceIsActiveConnection;
public bool InstanceIsActiveConnection
{
@@ -78,6 +91,11 @@ namespace Borepin.PageModel
{
IsBusy = true;
+ if(_BFFHService.IsConnected)
+ {
+ await _BFFHService.Disconnect().ConfigureAwait(true);
+ }
+
try
{
await _BFFHService.Connect(Connection_Item).ConfigureAwait(true);
@@ -159,13 +177,13 @@ namespace Borepin.PageModel
}
- public override void OnNavigatedTo(INavigationParameters parameters)
+ public override async void OnNavigatedTo(INavigationParameters parameters)
{
if(Connection_Item == null)
{
Connection_Item = parameters["instance"] as Connection;
- LoadData();
+ await LoadData().ConfigureAwait(false);
}
}
#endregion
diff --git a/Borepin/Borepin/Service/BFFH/BFFHService.cs b/Borepin/Borepin/Service/BFFH/BFFHService.cs
index 68ae895..5e767cd 100644
--- a/Borepin/Borepin/Service/BFFH/BFFHService.cs
+++ b/Borepin/Borepin/Service/BFFH/BFFHService.cs
@@ -157,6 +157,7 @@ namespace Borepin.Service.BFFH
if (! await _AuthenticatePlainAsync(connection.Username, password).ConfigureAwait(false))
{
+ await Disconnect().ConfigureAwait(false);
throw new AuthenticatingFailedException();
}
@@ -195,6 +196,7 @@ namespace Borepin.Service.BFFH
if (!await _AuthenticatePlainAsync(connection.Username, password).ConfigureAwait(false))
{
+ await Disconnect().ConfigureAwait(false);
throw new AuthenticatingFailedException();
}
diff --git a/Borepin/Borepin/Service/Versioning/IVersioningService.cs b/Borepin/Borepin/Service/Versioning/IVersioningService.cs
new file mode 100644
index 0000000..fdc36f3
--- /dev/null
+++ b/Borepin/Borepin/Service/Versioning/IVersioningService.cs
@@ -0,0 +1,8 @@
+namespace Borepin.Service.Versioning
+{
+ public interface IVersioningService
+ {
+ string CurrentBuild { get; }
+ string CurrentVersion { get; }
+ }
+}
diff --git a/Borepin/Borepin/View/MachineListItemView.xaml b/Borepin/Borepin/View/MachineListItemView.xaml
index 893c341..2f2f836 100644
--- a/Borepin/Borepin/View/MachineListItemView.xaml
+++ b/Borepin/Borepin/View/MachineListItemView.xaml
@@ -15,7 +15,7 @@
-
+
@@ -24,8 +24,11 @@
-
-
+
+
+
+
+
diff --git a/Borepin/Borepin/View/ServerListItemView.xaml b/Borepin/Borepin/View/ServerListItemView.xaml
index f380739..6049b8d 100644
--- a/Borepin/Borepin/View/ServerListItemView.xaml
+++ b/Borepin/Borepin/View/ServerListItemView.xaml
@@ -16,9 +16,9 @@
-
-
-
+
+
+
diff --git a/Borepin/Borepin/ViewModel/MachineListItemViewModel.cs b/Borepin/Borepin/ViewModel/MachineListItemViewModel.cs
index 5c5a1a6..7c46516 100644
--- a/Borepin/Borepin/ViewModel/MachineListItemViewModel.cs
+++ b/Borepin/Borepin/ViewModel/MachineListItemViewModel.cs
@@ -33,5 +33,12 @@ namespace Borepin.ViewModel
get => _State;
set => SetProperty(ref _State, value);
}
+
+ private bool _IsUserAssigned = false;
+ public bool IsUserAssigned
+ {
+ get => _IsUserAssigned;
+ set => SetProperty(ref _IsUserAssigned, value);
+ }
}
}
diff --git a/Borepin/Borepin/ViewModel/ServerListItemViewModel.cs b/Borepin/Borepin/ViewModel/ServerListItemViewModel.cs
index aa9b345..4d6b33f 100644
--- a/Borepin/Borepin/ViewModel/ServerListItemViewModel.cs
+++ b/Borepin/Borepin/ViewModel/ServerListItemViewModel.cs
@@ -1,6 +1,5 @@
using Borepin.Model;
using Prism.Mvvm;
-using System;
namespace Borepin.ViewModel
{
@@ -32,8 +31,5 @@ namespace Borepin.ViewModel
set => SetProperty(ref _Username, value);
}
#endregion
-
- #region Methods
- #endregion
}
}