Update Packages

This commit is contained in:
TheJoKlLa 2021-09-24 20:36:44 +02:00
commit 1d48abd51f
40 changed files with 13858 additions and 4769 deletions

View File

@ -103,11 +103,11 @@ build_iOS:
script: script:
- 'nuget restore' # restore Nuget dependencies - 'nuget restore' # restore Nuget dependencies
- 'msbuild /t:Restore' - 'msbuild /t:Restore'
- 'msbuild /t:Borepin_iOS /p:Configuration=Debug /p:Platform=iPhone /p:ArchiveOnBuild=true' # build the project /p:AndroidKeyStore=True - 'msbuild /t:Borepin_iOS /p:Configuration=Debug /p:Platform=iPhone /p:ArchiveOnBuild=true /p:BuildIpa=true' # build the project /p:AndroidKeyStore=True
artifacts: artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
paths: paths:
- Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.ipa - Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.iOS.ipa
- Borepin/Borepin.iOS/bin/iPhone/Debug/ - Borepin/Borepin.iOS/bin/iPhone/Debug/
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests # - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests

View File

@ -66,7 +66,7 @@
<PackageReference Include="Prism.DryIoc.Forms"> <PackageReference Include="Prism.DryIoc.Forms">
<Version>8.1.97</Version> <Version>8.1.97</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2125" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -2,6 +2,7 @@
using Android.App; using Android.App;
using Android.Content.PM; using Android.Content.PM;
using Android.OS; using Android.OS;
using AndroidX.AppCompat.App;
namespace Borepin.Droid namespace Borepin.Droid
{ {
@ -10,6 +11,8 @@ namespace Borepin.Droid
{ {
protected override void OnCreate(Bundle savedInstanceState) protected override void OnCreate(Bundle savedInstanceState)
{ {
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
TabLayoutResource = Resource.Layout.Tabbar; TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar; ToolbarResource = Resource.Layout.Toolbar;

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.props')" /> <Import Project="..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -89,20 +89,20 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Core">
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2083\lib\net45\webkit-sharp.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2083\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2083\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.5.0.0.2125\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="webkit-sharp">
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2083\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2125\lib\net45\webkit-sharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Xamarin.Forms.Platform.GTK">
<HintPath>..\..\packages\Xamarin.Forms.5.0.0.2083\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath> <HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.5.0.0.2125\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -123,12 +123,5 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Import Project="..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2125\build\Xamarin.Forms.targets')" />
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.5.0.0.2083\build\Xamarin.Forms.targets')" />
</Project> </Project>

View File

@ -5,6 +5,6 @@
<package id="Prism.Core" version="8.1.97" targetFramework="net48" /> <package id="Prism.Core" version="8.1.97" targetFramework="net48" />
<package id="Prism.DryIoc.Forms" version="8.1.97" targetFramework="net48" /> <package id="Prism.DryIoc.Forms" version="8.1.97" targetFramework="net48" />
<package id="Prism.Forms" version="8.1.97" targetFramework="net48" /> <package id="Prism.Forms" version="8.1.97" targetFramework="net48" />
<package id="Xamarin.Forms" version="5.0.0.2083" targetFramework="net48" /> <package id="Xamarin.Forms" version="5.0.0.2125" targetFramework="net48" />
<package id="Xamarin.Forms.Platform.GTK" version="5.0.0.2083" targetFramework="net48" /> <package id="Xamarin.Forms.Platform.GTK" version="5.0.0.2125" targetFramework="net48" />
</packages> </packages>

View File

@ -2,6 +2,5 @@
x:Class="Borepin.UWP.App" x:Class="Borepin.UWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Borepin.UWP"> xmlns:local="using:Borepin.UWP" RequestedTheme="Light">
</Application> </Application>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@ -183,7 +183,7 @@
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.Forms"> <PackageReference Include="Xamarin.Forms">
<Version>5.0.0.2083</Version> <Version>5.0.0.2125</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
@ -196,4 +196,8 @@
<ItemGroup> <ItemGroup>
<Folder Include="Assets.xcassets\LaunchIcon.imageset\" /> <Folder Include="Assets.xcassets\LaunchIcon.imageset\" />
</ItemGroup> </ItemGroup>
<Target Name="BeforeBuild" Condition=" '$(GITLAB_CI)' == 'true' ">
<XmlPoke XmlInputPath="Info.plist" Query="//dict/key[. = 'CFBundleVersion']/following-sibling::string[1]" Value="$(CI_PIPELINE_ID)" />
<XmlPoke XmlInputPath="Info.plist" Query="//dict/key[. = 'CFBundleShortVersionString']/following-sibling::string[1]" Value="0.1.0" />
</Target>
</Project> </Project>

View File

@ -40,5 +40,7 @@
<false/> <false/>
<key>NFCReaderUsageDescription</key> <key>NFCReaderUsageDescription</key>
<string>FabAccess needs to be able to read your card for authentication with the server.</string> <string>FabAccess needs to be able to read your card for authentication with the server.</string>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict> </dict>
</plist> </plist>

View File

@ -45,6 +45,7 @@ namespace Borepin
containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>(); containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>();
containerRegistry.RegisterForNavigation<ServerListPage, ServerListPageModel>(); containerRegistry.RegisterForNavigation<ServerListPage, ServerListPageModel>();
containerRegistry.RegisterForNavigation<ServerPage, ServerPageModel>(); containerRegistry.RegisterForNavigation<ServerPage, ServerPageModel>();
containerRegistry.RegisterForNavigation<ListPage, ListPageModel>();
containerRegistry.RegisterForNavigation<WelcomePage, WelcomePageModel>("SetUpProcess_WelcomePage"); containerRegistry.RegisterForNavigation<WelcomePage, WelcomePageModel>("SetUpProcess_WelcomePage");
//containerRegistry.RegisterForNavigation<ScanPage, ScanPageModel>("SetUpProcess_ScanPage"); //containerRegistry.RegisterForNavigation<ScanPage, ScanPageModel>("SetUpProcess_ScanPage");

View File

@ -28,7 +28,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Plugin.Multilingual" Version="1.0.2" /> <PackageReference Include="Plugin.Multilingual" Version="1.0.2" />
<PackageReference Include="Prism.DryIoc.Forms" Version="8.1.97" /> <PackageReference Include="Prism.DryIoc.Forms" Version="8.1.97" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2125" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" /> <PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -65,6 +65,9 @@
<EmbeddedResource Update="Page\AddServerProcess\HostSelectPage.xaml"> <EmbeddedResource Update="Page\AddServerProcess\HostSelectPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Page\ListPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Page\AddServerProcess\LoginChoosePage.xaml"> <EmbeddedResource Update="Page\AddServerProcess\LoginChoosePage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
@ -92,6 +95,9 @@
<EmbeddedResource Update="Page\StartUpDistributorPage.xaml"> <EmbeddedResource Update="Page\StartUpDistributorPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Page\TestPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx"> <EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -103,6 +109,12 @@
<EmbeddedResource Update="Styles\LightTheme.xaml"> <EmbeddedResource Update="Styles\LightTheme.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="View\IsBusyView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="View\ListItemView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="View\ScanView.xaml"> <EmbeddedResource Update="View\ScanView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>

View File

@ -29,12 +29,12 @@ namespace Borepin.Model
State = _Machine.State; State = _Machine.State;
Manager = new UserVisualize(_Machine.Manager); Manager = new UserVisualize(_Machine.Manager);
CanUse = _Machine.Use != null; CanUse = !((UseInterface_Proxy)_Machine.Use).IsNull;
CanInUse = _Machine.Inuse != null; CanInUse = !((InUseInterface_Proxy) _Machine.Inuse).IsNull;
CanTransfer = _Machine.Transfer != null; CanTransfer = !((TransferInterface_Proxy) _Machine.Transfer).IsNull;
CanCheck = _Machine.Check != null; CanCheck = !((CheckInterface_Proxy) _Machine.Check).IsNull;
CanManage = _Machine.Manage != null; CanManage = !((ManageInterface_Proxy) _Machine.Manage).IsNull;
CanAdmin = _Machine.Admin != null; CanAdmin = !((AdminInterface_Proxy) _Machine.Admin).IsNull;
} }
#endregion #endregion

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:Borepin.View"
x:Class="Borepin.Page.ListPage">
<ContentPage.Content>
<StackLayout>
<ListView ItemsSource="{Binding ListItemViewModel_List}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<views:ListItemView />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
</ContentPage>

View File

@ -0,0 +1,15 @@

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Borepin.Page
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ListPage : ContentPage
{
public ListPage()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.Page.SetUpProcess.ScanPage"
xmlns:i18n="clr-namespace:Borepin.Helpers"
xmlns:views="clr-namespace:Borepin.View">
<ContentPage.Content>
<ScrollView>
<StackLayout Style="{StaticResource Style_StackLayout_Content}">
<views:ScanView />
<Label Text="{i18n:Translate SetUp_ScanPage_Text}" Style="{StaticResource Style_Label_Text}"/>
<Button Text="{i18n:Translate SetUp_ScanPage_Button}" Command="{Binding NextCommand}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.Page.TestPage"
xmlns:converters="clr-namespace:Borepin.Converter">
<ContentPage.Resources>
<ResourceDictionary>
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="20">
<StackLayout IsVisible="{Binding IsBusy}">
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="TestPage"/>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Borepin.Page
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class TestPage : ContentPage
{
public TestPage()
{
InitializeComponent();
}
}
}

View File

@ -31,12 +31,11 @@ namespace Borepin.PageModel.AddServerProcess
#endregion #endregion
#region LoadData #region LoadData
public override async Task LoadData() public override Task LoadData()
{ {
IsBusy = true;
IsBusy = false; IsBusy = false;
await Task.CompletedTask;
return Task.CompletedTask;
} }
#endregion #endregion
@ -125,8 +124,7 @@ namespace Borepin.PageModel.AddServerProcess
public override void OnNavigatedTo(INavigationParameters parameters) public override void OnNavigatedTo(INavigationParameters parameters)
{ {
IsBusy = true;
Task.Run(LoadData);
} }
#endregion #endregion
} }

View File

@ -16,12 +16,11 @@ namespace Borepin.PageModel.AddServerProcess
#endregion #endregion
#region LoadData #region LoadData
public override async Task LoadData() public override Task LoadData()
{ {
IsBusy = true;
IsBusy = false; IsBusy = false;
await Task.CompletedTask;
return Task.CompletedTask;
} }
#endregion #endregion
@ -51,8 +50,7 @@ namespace Borepin.PageModel.AddServerProcess
public override void OnNavigatedTo(INavigationParameters parameters) public override void OnNavigatedTo(INavigationParameters parameters)
{ {
IsBusy = true; IsBusy = false;
Task.Run(LoadData);
} }
#endregion #endregion
} }

View File

@ -4,6 +4,7 @@ using Borepin.Service.BFFH;
using Borepin.Service.Connections; using Borepin.Service.Connections;
using Prism.Commands; using Prism.Commands;
using Prism.Navigation; using Prism.Navigation;
using Prism.Services;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
@ -15,13 +16,16 @@ namespace Borepin.PageModel.AddServerProcess
#region Private Properties #region Private Properties
private readonly IBFFHService _BFFHService; private readonly IBFFHService _BFFHService;
private readonly IConnectionService _ConnectionService; private readonly IConnectionService _ConnectionService;
private readonly IPageDialogService _PageDialogService;
#endregion #endregion
#region Constructors #region Constructors
public LoginPasswordPageModel(INavigationService navigationService, IBFFHService bffhService, IConnectionService connectionService) : base(navigationService) public LoginPasswordPageModel(INavigationService navigationService, IBFFHService bffhService, IConnectionService connectionService, IPageDialogService pageDialogService) : base(navigationService)
{ {
_BFFHService = bffhService; _BFFHService = bffhService;
_ConnectionService = connectionService; _ConnectionService = connectionService;
_PageDialogService = pageDialogService;
AuthenticateCommand = new DelegateCommand(async () => await AuthenticateCommandExecuted()); AuthenticateCommand = new DelegateCommand(async () => await AuthenticateCommandExecuted());
@ -30,12 +34,11 @@ namespace Borepin.PageModel.AddServerProcess
#endregion #endregion
#region LoadData #region LoadData
public override async Task LoadData() public override Task LoadData()
{ {
IsBusy = true;
IsBusy = false; IsBusy = false;
await Task.CompletedTask;
return Task.CompletedTask;
} }
#endregion #endregion
@ -65,11 +68,19 @@ namespace Borepin.PageModel.AddServerProcess
private async Task AuthenticateCommandExecuted() private async Task AuthenticateCommandExecuted()
{ {
IsBusy = true;
Connection connection_update = _BFFHService.ActiveConnection; Connection connection_update = _BFFHService.ActiveConnection;
connection_update.Username = Username; connection_update.Username = Username;
await _BFFHService.Authenticate(connection_update, Password).ConfigureAwait(false); if(!await _BFFHService.Authenticate(connection_update, Password))
{
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to authenticate to server.", "Ok");
IsBusy = false;
return;
}
try try
{ {
@ -77,7 +88,7 @@ namespace Borepin.PageModel.AddServerProcess
} }
catch (ArgumentException) catch (ArgumentException)
{ {
// Could be better catched
} }
await _ConnectionService.LogConnect(_BFFHService.ActiveConnection); await _ConnectionService.LogConnect(_BFFHService.ActiveConnection);
@ -99,8 +110,7 @@ namespace Borepin.PageModel.AddServerProcess
public override void OnNavigatedTo(INavigationParameters parameters) public override void OnNavigatedTo(INavigationParameters parameters)
{ {
IsBusy = true;
Task.Run(LoadData);
} }
#endregion #endregion
} }

View File

@ -0,0 +1,57 @@
using Borepin.Model;
using Borepin.ViewModel;
using Prism.Mvvm;
using System.Collections.Generic;
using System.Windows.Input;
using Xamarin.Forms;
namespace Borepin.PageModel
{
public class ListPageModel : BindableBase
{
public ListPageModel()
{
ListItemViewModel_List = new List<ListItemViewModel>()
{
new ListItemViewModel(
new ListItem()
{
Value1 = "ListItem 1"
}),
new ListItemViewModel(
new ListItem()
{
Value1 = "ListItem 2"
}),
new ListItemViewModel(
new ListItem()
{
Value1 = "ListItem 3"
}),
};
SelectListItemCommand = new Command<object>(SelectListItemCommandExecuted);
}
private List<ListItemViewModel> _ListItemViewModel_List;
public List<ListItemViewModel> ListItemViewModel_List
{
get => _ListItemViewModel_List;
set => SetProperty(ref _ListItemViewModel_List, value);
}
private ICommand _SelectListItemCommand;
public ICommand SelectListItemCommand
{
get => _SelectListItemCommand;
set => SetProperty(ref _SelectListItemCommand, value);
}
private void SelectListItemCommandExecuted(object obj)
{
System.Diagnostics.Debugger.Break();
}
}
}

View File

@ -25,11 +25,9 @@ namespace Borepin.PageModel
} }
#endregion #endregion
#region LoadData #region Data
public override async Task LoadData() public override async Task LoadData()
{ {
IsBusy = true;
if (_BFFHService.ActiveConnection == null) if (_BFFHService.ActiveConnection == null)
{ {
IsBusy = false; IsBusy = false;

View File

@ -28,7 +28,7 @@ namespace Borepin.PageModel
} }
#endregion #endregion
#region LoadData #region Data
public override async Task LoadData() public override async Task LoadData()
{ {
IsBusy = true; IsBusy = true;

View File

@ -1,31 +1,20 @@
using Borepin.Base; using Prism.Mvvm;
using Prism.Navigation; using Prism.Navigation;
using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using Xamarin.Forms; using Xamarin.Forms;
namespace Borepin.PageModel namespace Borepin.PageModel
{ {
public class MainPagePageModel : PageModelBase public class MainPagePageModel : BindableBase
{ {
#region Constructors private INavigationService _NavigationService;
public MainPagePageModel(INavigationService navigationService) : base(navigationService)
public MainPagePageModel(INavigationService navigationService)
{ {
_NavigationService = navigationService;
NavigateCommand = new Command<string>(NavigateCommandExecuted); NavigateCommand = new Command<string>(NavigateCommandExecuted);
} }
#endregion
#region LoadData
public override async Task LoadData()
{
IsBusy = true;
IsBusy = false;
await LoadData();
}
#endregion
#region Commands
private ICommand _NavigationCommand; private ICommand _NavigationCommand;
public ICommand NavigateCommand public ICommand NavigateCommand
@ -42,19 +31,5 @@ namespace Borepin.PageModel
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();
} }
} }
#endregion
#region INavigationService
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)
{
IsBusy = false;
//Task.Run(LoadData);
}
#endregion
} }
} }

View File

@ -31,11 +31,9 @@ namespace Borepin.PageModel
} }
#endregion #endregion
#region LoadData #region Data
public override async Task LoadData() public override async Task LoadData()
{ {
IsBusy = true;
List<Connection> list = await _ConnectionService.GetConnectionList(); List<Connection> list = await _ConnectionService.GetConnectionList();
if (_BFFHService.ActiveConnection != null) if (_BFFHService.ActiveConnection != null)
{ {

View File

@ -37,13 +37,10 @@ namespace Borepin.PageModel
} }
#endregion #endregion
#region LoadData #region Data
public override async Task LoadData() public override Task LoadData()
{ {
IsBusy = true; throw new System.NotImplementedException();
IsBusy = false;
await LoadData();
} }
#endregion #endregion
@ -94,7 +91,14 @@ namespace Borepin.PageModel
IsBusy = false; IsBusy = false;
return; return;
} }
await _BFFHService.Authenticate();
if(!await _BFFHService.Authenticate())
{
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to authenticate to server.", "Ok");
IsBusy = false;
return;
}
IsConnected = true; IsConnected = true;
} }
@ -169,8 +173,7 @@ namespace Borepin.PageModel
IsConnected = false; IsConnected = false;
} }
IsBusy = true; IsBusy = false;
Task.Run(LoadData);
} }
#endregion #endregion
} }

View File

@ -0,0 +1,54 @@
using Borepin.Base;
using Prism.Commands;
using Prism.Navigation;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Borepin.PageModel.SetUpProcess
{
public class ScanPageModel : PageModelBase
{
#region Constructors
public ScanPageModel(INavigationService navigationService) : base(navigationService)
{
NextCommand = new DelegateCommand<object>(NextCommandCommandExecuted);
}
#endregion
#region Data
public override Task LoadData()
{
return Task.CompletedTask;
}
#endregion
#region Commands
private ICommand _NextCommand;
public ICommand NextCommand
{
get => _NextCommand;
set => SetProperty(ref _NextCommand, value);
}
private async void NextCommandCommandExecuted(object obj)
{
INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_HostSelectPage");
if (!result.Success)
{
System.Diagnostics.Debugger.Break();
}
}
#endregion
#region INavigationAware
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)
{
}
#endregion
}
}

View File

@ -15,13 +15,10 @@ namespace Borepin.PageModel.SetUpProcess
} }
#endregion #endregion
#region LoadData #region Data
public override async Task LoadData() public override Task LoadData()
{ {
IsBusy = true; return Task.CompletedTask;
IsBusy = false;
await Task.CompletedTask;
} }
#endregion #endregion
@ -34,7 +31,8 @@ namespace Borepin.PageModel.SetUpProcess
} }
private async void NextCommandCommandExecuted(object obj) private async void NextCommandCommandExecuted(object obj)
{ {
INavigationResult result = await _NavigationService.NavigateAsync("SetUpProcess_ScanPage"); //INavigationResult result = await _NavigationService.NavigateAsync("SetUpProcess_ScanPage");
INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_HostSelectPage");
if (!result.Success) if (!result.Success)
{ {
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();
@ -50,8 +48,7 @@ namespace Borepin.PageModel.SetUpProcess
public override void OnNavigatedTo(INavigationParameters parameters) public override void OnNavigatedTo(INavigationParameters parameters)
{ {
IsBusy = true;
Task.Run(LoadData);
} }
#endregion #endregion
} }

View File

@ -27,12 +27,9 @@ namespace Borepin.PageModel
#endregion #endregion
#region LoadData #region LoadData
public override async Task LoadData() public override Task LoadData()
{ {
IsBusy = true; return Task.CompletedTask;
IsBusy = false;
await LoadData();
} }
#endregion #endregion
@ -78,8 +75,7 @@ namespace Borepin.PageModel
public override void OnNavigatedTo(INavigationParameters parameters) public override void OnNavigatedTo(INavigationParameters parameters)
{ {
IsBusy = true;
Task.Run(LoadData);
} }
#endregion #endregion
} }

View File

@ -0,0 +1,39 @@
using Borepin.Base;
using Prism.Navigation;
using System.Threading.Tasks;
namespace Borepin.PageModel
{
class TestPageModel : PageModelBase
{
#region Contructors
public TestPageModel(INavigationService navigationService) : base(navigationService)
{
}
#endregion
#region Data
public override Task LoadData()
{
Task.Delay(3000);
IsBusy = false;
return Task.CompletedTask;
}
#endregion
#region INavigationService
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)
{
IsBusy = true;
Task.Run(LoadData);
}
#endregion
}
}

View File

@ -10,48 +10,35 @@
namespace Borepin.Resources.Text { namespace Borepin.Resources.Text {
using System; using System;
using System.Reflection;
/// <summary> [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
/// A strongly-typed resource class, for looking up localized strings, etc. [System.Diagnostics.DebuggerNonUserCodeAttribute()]
/// </summary> [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
// 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 { internal class TextResource {
private static global::System.Resources.ResourceManager resourceMan; private static System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal TextResource() { internal TextResource() {
} }
/// <summary> [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
/// Returns the cached ResourceManager instance used by this class. internal static System.Resources.ResourceManager ResourceManager {
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.Equals(null, resourceMan)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Borepin.Resources.Text.TextResource", typeof(TextResource).Assembly); System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Borepin.Resources.Text.TextResource", typeof(TextResource).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;
} }
} }
/// <summary> [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
/// Overrides the current thread's CurrentUICulture property for all internal static System.Globalization.CultureInfo Culture {
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get { get {
return resourceCulture; return resourceCulture;
} }
@ -60,45 +47,30 @@ namespace Borepin.Resources.Text {
} }
} }
/// <summary>
/// Looks up a localized string similar to Login to your Space.
/// </summary>
internal static string SetUp_ScanPage_Button { internal static string SetUp_ScanPage_Button {
get { get {
return ResourceManager.GetString("SetUp_ScanPage_Button", resourceCulture); return ResourceManager.GetString("SetUp_ScanPage_Button", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Wenn du dieses Logo siehst, dann kannst du es scannen.
/// </summary>
internal static string SetUp_ScanPage_Text { internal static string SetUp_ScanPage_Text {
get { get {
return ResourceManager.GetString("SetUp_ScanPage_Text", resourceCulture); return ResourceManager.GetString("SetUp_ScanPage_Text", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Start working.
/// </summary>
internal static string SetUp_WelcomePage_Button { internal static string SetUp_WelcomePage_Button {
get { get {
return ResourceManager.GetString("SetUp_WelcomePage_Button", resourceCulture); return ResourceManager.GetString("SetUp_WelcomePage_Button", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann.
/// </summary>
internal static string SetUp_WelcomePage_Text { internal static string SetUp_WelcomePage_Text {
get { get {
return ResourceManager.GetString("SetUp_WelcomePage_Text", resourceCulture); return ResourceManager.GetString("SetUp_WelcomePage_Text", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to Welcome.
/// </summary>
internal static string SetUp_WelcomePage_Title { internal static string SetUp_WelcomePage_Title {
get { get {
return ResourceManager.GetString("SetUp_WelcomePage_Title", resourceCulture); return ResourceManager.GetString("SetUp_WelcomePage_Title", resourceCulture);

View File

@ -124,10 +124,10 @@
<value>Wenn du dieses Logo siehst, dann kannst du es scannen</value> <value>Wenn du dieses Logo siehst, dann kannst du es scannen</value>
</data> </data>
<data name="SetUp_WelcomePage_Button" xml:space="preserve"> <data name="SetUp_WelcomePage_Button" xml:space="preserve">
<value>Start working</value> <value>Begin working</value>
</data> </data>
<data name="SetUp_WelcomePage_Text" xml:space="preserve"> <data name="SetUp_WelcomePage_Text" xml:space="preserve">
<value>Hier muss ein kurzer Text hin was FabAccess ist und was man damit machen kann</value> <value>Automate your Space with FabAccess</value>
</data> </data>
<data name="SetUp_WelcomePage_Title" xml:space="preserve"> <data name="SetUp_WelcomePage_Title" xml:space="preserve">
<value>Welcome</value> <value>Welcome</value>

View File

@ -75,20 +75,21 @@ namespace Borepin.Service.BFFH
{ {
string password = await _CredentialService.GetPasswordAsync(ActiveConnection); string password = await _CredentialService.GetPasswordAsync(ActiveConnection);
await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } }); return await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } });
return await Task.FromResult(true);
} }
public async Task<bool> Authenticate(Connection connection, string password) public async Task<bool> Authenticate(Connection connection, string password)
{ {
await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } }).ConfigureAwait(false); bool result = await _Connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", ActiveConnection.Username }, { "Password", password } });
if(result == true)
{
await _CredentialService.AddCredentialsAsync(connection, password); await _CredentialService.AddCredentialsAsync(connection, password);
ActiveConnection = connection; ActiveConnection = connection;
}
return await Task.FromResult(true); return result;
} }
public Task<IMachineSystem> GetMachineSystemInterface() public Task<IMachineSystem> GetMachineSystemInterface()

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.View.IsBusyView">
<ContentView.Content>
<StackLayout>
<Label Text="IsBusy" />
</StackLayout>
</ContentView.Content>
</ContentView>

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Borepin.View
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class IsBusyView : ContentView
{
public IsBusyView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Borepin.View.ListItemView"
xmlns:pagemodel="clr-namespace:Borepin.PageModel">
<ContentView.Content>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="{Binding Value}" />
<Button Text="X" Command="{Binding Source={RelativeSource AncestorType={x:Type pagemodel:ListPageModel}}, Path=SelectListItemCommand}" CommandParameter="{Binding .}" />
</StackLayout>
</ContentView.Content>
</ContentView>

View File

@ -0,0 +1,15 @@

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Borepin.View
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ListItemView : ContentView
{
public ListItemView()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,20 @@
using Borepin.Model;
using Prism.Mvvm;
namespace Borepin.ViewModel
{
public class ListItemViewModel : BindableBase
{
public ListItemViewModel(ListItem listItem)
{
Value = listItem.Value1;
}
private string _Value;
public string Value
{
get => _Value;
set => SetProperty(ref _Value, value);
}
}
}

View File

@ -124,7 +124,6 @@ namespace FabAccessAPI
public async Task<bool> Authenticate(string mech, Dictionary<string, object> properties) public async Task<bool> Authenticate(string mech, Dictionary<string, object> properties)
{ {
var m = SaslFactory.Create(mech); var m = SaslFactory.Create(mech);
foreach (KeyValuePair<string, object> entry in properties) foreach (KeyValuePair<string, object> entry in properties)
{ {

View File

@ -40,11 +40,15 @@ namespace FabAccessAPI
/// <param name="mech">The desired authentication mechanism</param> /// <param name="mech">The desired authentication mechanism</param>
/// <param name="kvs">Key-Value data specific to the mechanism</param> /// <param name="kvs">Key-Value data specific to the mechanism</param>
/// <returns></returns> /// <returns></returns>
public async Task Auth(string mech, Dictionary<string, object> kvs, CancellationToken cancellationToken_ = default) public async Task<bool> Auth(string mech, Dictionary<string, object> kvs, CancellationToken cancellationToken_ = default)
{ {
// _bootstrapCap = await _bootstrapCap.Unwrap(); // _bootstrapCap = await _bootstrapCap.Unwrap();
var authCap = await _bootstrapCap.AuthenticationSystem(cancellationToken_).ConfigureAwait(false); if(_auth == null)
{
var authCap = await _bootstrapCap.AuthenticationSystem(cancellationToken_);
_auth = new Auth(authCap); _auth = new Auth(authCap);
}
var mechs = await _auth.GetMechanisms(); var mechs = await _auth.GetMechanisms();
//_Log.Debug($"The Server supports the following auth mechs: {string.Join(", ", mechs)}"); //_Log.Debug($"The Server supports the following auth mechs: {string.Join(", ", mechs)}");
@ -53,7 +57,7 @@ namespace FabAccessAPI
throw new UnsupportedMechanismException(); throw new UnsupportedMechanismException();
} }
await _auth.Authenticate(mech, kvs); return await _auth.Authenticate(mech, kvs);
} }
/// <summary> /// <summary>