Merge branch 'machinelist' into 'master'

Machinelist

See merge request fabinfra/fabaccess/borepin!8
This commit is contained in:
TheJoKlLa 2021-02-24 21:44:44 +00:00
commit 158cab6b23
66 changed files with 2728 additions and 992 deletions

View File

@ -23,7 +23,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FabAccessAPI", "FabAccessAP
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "S22.Sasl", "external\SASL\S22.Sasl.csproj", "{7FEC3D5E-C240-41B6-BBFA-895C4F4D45CA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FabAccessAPI_Test", "FabAccessAPI_Test\FabAccessAPI_Test.csproj", "{1C85978A-9FC0-4064-8399-FA2455C5EC2A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FabAccessAPI_Test", "FabAccessAPI_Test\FabAccessAPI_Test.csproj", "{1C85978A-9FC0-4064-8399-FA2455C5EC2A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -54,9 +54,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms">
<Version>8.0.0.1909</Version>
<Version>7.2.0.1422</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1351" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
<ItemGroup>

View File

@ -1,10 +1,6 @@
using System;

using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace Borepin.Droid

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="org.fab_infra.fabaccess" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="org.fabinfra.fabaccess" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:theme="@style/MainTheme" android:label="FabAccess"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,6 @@
using Android.App;
using Android.OS;
using Android.Support.V7.App;
using Android.Content;
using Android.Util;
namespace Borepin.Droid
{

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" />
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -75,11 +75,11 @@
<Reference Include="Prism, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Core.8.0.0.1909\lib\net47\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.DryIoc.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.DryIoc.Forms.8.0.0.1909\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
<Reference Include="Prism.DryIoc.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.DryIoc.Forms.7.2.0.1422\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
</Reference>
<Reference Include="Prism.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Forms.8.0.0.1909\lib\netstandard2.0\Prism.Forms.dll</HintPath>
<Reference Include="Prism.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Forms.7.2.0.1422\lib\netstandard2.0\Prism.Forms.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -90,19 +90,19 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.8.0.1687\lib\net45\webkit-sharp.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.7.0.1351\lib\net45\webkit-sharp.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.8.0.1687\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.7.0.1351\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -124,10 +124,10 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<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>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" />
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" />
</Project>

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden

View File

@ -3,8 +3,8 @@
<package id="DryIoc.dll" version="4.5.1" targetFramework="net48" />
<package id="OpenTK" version="3.2" targetFramework="net48" />
<package id="Prism.Core" version="8.0.0.1909" targetFramework="net472" />
<package id="Prism.DryIoc.Forms" version="8.0.0.1909" targetFramework="net48" />
<package id="Prism.Forms" version="8.0.0.1909" targetFramework="net48" />
<package id="Xamarin.Forms" version="4.8.0.1687" targetFramework="net48" />
<package id="Xamarin.Forms.Platform.GTK" version="4.8.0.1687" targetFramework="net48" />
<package id="Prism.DryIoc.Forms" version="7.2.0.1422" targetFramework="net48" />
<package id="Prism.Forms" version="7.2.0.1422" targetFramework="net48" />
<package id="Xamarin.Forms" version="4.7.0.1351" targetFramework="net48" />
<package id="Xamarin.Forms.Platform.GTK" version="4.7.0.1351" targetFramework="net48" />
</packages>

View File

@ -1,18 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace Borepin.UWP

View File

@ -172,9 +172,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms">
<Version>8.0.0.1909</Version>
<Version>7.2.0.1422</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1351" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.11" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>

View File

@ -1,19 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace Borepin.UWP
namespace Borepin.UWP
{
public sealed partial class MainPage
{

View File

@ -1,5 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Resources;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@ -26,4 +26,5 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("")]

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using UIKit;

View File

@ -175,7 +175,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms">
<Version>8.0.0.1909</Version>
<Version>7.2.0.1422</Version>
</PackageReference>
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms">

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
using UIKit;
namespace Borepin.iOS
{

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@ -2,7 +2,6 @@
using Foundation;
using Xamarin.Forms;
using Xamarin.Forms.Platform.MacOS;
using Borepin;
namespace Borepin.macOS
{

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" />
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -65,22 +65,22 @@
<Reference Include="Prism, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Core.8.0.0.1909\lib\netstandard2.0\Prism.dll</HintPath>
</Reference>
<Reference Include="Prism.DryIoc.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.DryIoc.Forms.8.0.0.1909\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
<Reference Include="Prism.DryIoc.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.DryIoc.Forms.7.2.0.1422\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
</Reference>
<Reference Include="Prism.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Forms.8.0.0.1909\lib\netstandard2.0\Prism.Forms.dll</HintPath>
<Reference Include="Prism.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Prism.Forms.7.2.0.1422\lib\netstandard2.0\Prism.Forms.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Mac" />
</ItemGroup>
@ -127,10 +127,10 @@
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<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>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" />
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" />
</Project>

View File

@ -2,8 +2,8 @@
<packages>
<package id="DryIoc.dll" version="4.5.1" targetFramework="xamarinmac20" />
<package id="Prism.Core" version="8.0.0.1909" targetFramework="xamarinmac20" />
<package id="Prism.DryIoc.Forms" version="8.0.0.1909" targetFramework="xamarinmac20" />
<package id="Prism.Forms" version="8.0.0.1909" targetFramework="xamarinmac20" />
<package id="Prism.DryIoc.Forms" version="7.2.0.1422" targetFramework="xamarinmac20" />
<package id="Prism.Forms" version="7.2.0.1422" targetFramework="xamarinmac20" />
<package id="System.Reflection.Emit.Lightweight" version="4.7.0" targetFramework="xamarinmac20" />
<package id="Xamarin.Forms" version="4.8.0.1687" targetFramework="xamarinmac20" />
<package id="Xamarin.Forms" version="4.7.0.1351" targetFramework="xamarinmac20" />
</packages>

View File

@ -50,9 +50,9 @@ namespace Borepin
// Register Navigation
containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<MainPage, MainPagePageModel>();
containerRegistry.RegisterForNavigation<MachinesPage, MachinesPageModel>();
containerRegistry.RegisterForNavigation<SettingsPage>();
containerRegistry.RegisterForNavigation<MachinePage, MachinePageModel>();
containerRegistry.RegisterForNavigation<SettingsPage>();
containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>();
containerRegistry.RegisterForNavigation<LoginPasswordPage, LoginPasswordPageModel>();
containerRegistry.RegisterForNavigation<HostSelectPage, HostSelectPageModel>();
containerRegistry.RegisterForNavigation<LoginChoosePage, LoginChoosePageModel>();

View File

@ -21,15 +21,15 @@
</Target>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Prism.DryIoc.Forms" Version="8.0.0.1909" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Prism.DryIoc.Forms" Version="7.2.0.1422" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1351" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Xamarin.Forms.EntryAutoComplete" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Update="Page\MachinesPage.xaml.cs">
<DependentUpon>MachinesPage.xaml</DependentUpon>
<Compile Update="Page\MachineListPage.xaml.cs">
<DependentUpon>MachineListPage.xaml</DependentUpon>
</Compile>
<Compile Update="Page\SettingsPage.xaml.cs">
<DependentUpon>SettingsPage.xaml</DependentUpon>
@ -47,6 +47,9 @@
<Compile Update="Styles\LightTheme.xaml.cs">
<DependentUpon>LightTheme.xaml</DependentUpon>
</Compile>
<Compile Update="View\MachineListItemView.xaml.cs">
<DependentUpon>MachineListItemView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Dialog\ConfirmDialog.xaml">
@ -67,9 +70,6 @@
<EmbeddedResource Update="Page\MachinePage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Page\MachinesPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Page\MainPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>

View File

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Borepin.Model;
using Xamarin.Forms;
namespace Borepin.Converter
@ -11,9 +8,9 @@ namespace Borepin.Converter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
switch((MachineStates)value)
switch((FabAccessAPI.Schema.State)value)
{
case (MachineStates.Free):
case (FabAccessAPI.Schema.State.free):
return (Color)Application.Current.Resources["FirstColor"];
default:
return (Color)Application.Current.Resources["SixthColor"];

View File

@ -0,0 +1,35 @@
using System;
using System.Globalization;
using Xamarin.Forms;
namespace Borepin.Converter
{
public class MachineStateStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
switch((FabAccessAPI.Schema.State)value)
{
case (FabAccessAPI.Schema.State.free):
return "Free";
case (FabAccessAPI.Schema.State.inUse):
return "In Use";
case (FabAccessAPI.Schema.State.toCheck):
return "To Check";
case (FabAccessAPI.Schema.State.reserved):
return "Reserved";
case (FabAccessAPI.Schema.State.blocked):
return "Blocked";
case (FabAccessAPI.Schema.State.disabled):
return "Disabled";
default:
return "Unknown";
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Borepin.Model
{

View File

@ -1,54 +1,8 @@
using Prism.Mvvm;
namespace Borepin.Model
namespace Borepin.Model
{
public enum MachineStates
public class Machine
{
Free,
InUse,
ToCheck,
Blocked,
Disabled,
Reserved
}
public class Machine : BindableBase
{
private string _ID;
public string ID
{
get => _ID;
set => SetProperty(ref _ID, value);
}
private MachineStates _State;
public MachineStates State
{
get => _State;
set => SetProperty(ref _State, value);
}
private string _Description;
public string Description
{
get => _Description;
set => SetProperty(ref _Description, value);
}
private User _User;
public User User
{
get => _User;
set => SetProperty(ref _User, value);
}
}
public class User
{
public string ID { get; set; }
public string Name { get; set; }
public string OriginalWorkshop { get; set; }
public FabAccessAPI.Machine Instance { get; set; }
public FabAccessAPI.Schema.Machine.MInfo MInfo { get; set; }
}
}

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -0,0 +1,22 @@
<?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.MachineListPage">
<NavigationPage.TitleView>
<Label Text="Machines" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
</NavigationPage.TitleView>
<ContentPage.Content>
<StackLayout>
<ListView ItemsSource="{Binding MachineListItemViewModel_List}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<views:MachineListItemView />
</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 MachineListPage : ContentPage
{
public MachineListPage()
{
InitializeComponent();
}
}
}

View File

@ -14,23 +14,10 @@
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="20">
<Label Text="{Binding Machine.ID}" Style="{StaticResource LabelStyle_Title}"/>
<Label Text="Current User" IsVisible="{Binding Machine.User, Converter={StaticResource IsNotNullBoolConverter}}" Style="{StaticResource LabelStyle_PropertyTitle}"></Label>
<Label Text="{Binding Machine.User.Name}" IsVisible="{Binding Machine.User, Converter={StaticResource IsNotNullBoolConverter}}" Style="{StaticResource LabelStyle_PropertyText}"/>
<Label Text="Description" Style="{StaticResource LabelStyle_PropertyTitle}"></Label>
<Label Text="{Binding Machine.Description}" Style="{StaticResource LabelStyle_PropertyText}"/>
<Button Text="Reserve" Command="{Binding ReserveMachineCommand}" IsVisible="{Binding CanReserve}" Style="{StaticResource ButtonStyle_Primary}"/>
<Label Text="{Binding Name}" Style="{StaticResource LabelStyle_Title}"/>
<Button Text="Use" Command="{Binding UseMachineCommand}" IsVisible="{Binding CanUse}" Style="{StaticResource ButtonStyle_Primary}"/>
<Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" IsVisible="{Binding CanGiveBack}" Style="{StaticResource ButtonStyle_Primary}"/>
<Grid>
<Button Grid.Column="0" Text="Disable" Command="{Binding DisableMachineCommand}" IsVisible="{Binding IsAdmin}" Style="{StaticResource ButtonStyle_Admin}"/>
<Button Grid.Column="1" Text="Block" Command="{Binding BlockMachineCommand}" IsVisible="{Binding IsAdmin}" Style="{StaticResource ButtonStyle_Admin}"/>
</Grid>
</StackLayout>
</ContentPage.Content>
</ContentPage>

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,43 +0,0 @@
<?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.MachinesPage"
xmlns:converters="clr-namespace:Borepin.Converter">
<NavigationPage.TitleView>
<Label Text="Machines" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
</NavigationPage.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<converters:MachineStateColorConverter x:Key="MachineStateColorConverter"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="0, 10, 0, 10">
<ListView x:Name="MachineList" ItemsSource="{Binding MachineList}" SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="1"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="1" Text="{Binding ID, StringFormat='{0}'}" Style="{StaticResource LabelStyle_Primary}"/>
<Label Grid.Row="0" Grid.Column="2" Text="{Binding State, StringFormat='{0}'}" Style="{StaticResource LabelStyle_Second}" HorizontalTextAlignment="End" TextColor="{Binding State, Converter={StaticResource MachineStateColorConverter}}" />
<Button Grid.Row="0" Grid.Column="3" Margin="0, 3, 0, 3" Text="->" Command="{Binding BindingContext.GoToMachineCommand, Source={x:Reference MachineList}}" CommandParameter="{Binding .}" Style="{StaticResource ButtonStyle_Primary}"/>
<BoxView Grid.Row="1" Grid.ColumnSpan="5" BackgroundColor="{StaticResource FifthColor}"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
</ContentPage>

View File

@ -1,20 +0,0 @@
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 MachinesPage : ContentPage
{
public MachinesPage()
{
InitializeComponent();
}
}
}

View File

@ -7,7 +7,7 @@
<MasterDetailPage.Master>
<ContentPage Title="FabAccess">
<StackLayout>
<Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachinesPage" />
<Button Text="Machines" Command="{Binding NavigateCommand}" CommandParameter="MachineListPage" />
<Button Text="Settings" Command="{Binding NavigateCommand}" CommandParameter="SettingsPage" />
<Button Text="Servers" Command="{Binding NavigateCommand}" CommandParameter="ServerListPage" />
</StackLayout>

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -1,5 +1,4 @@
using Borepin.Model;
using Borepin.Service.BFFH;
using Borepin.Service.BFFH;
using Borepin.Service.Connections;
using Prism.Mvvm;
using Prism.Navigation;
@ -13,15 +12,13 @@ namespace Borepin.PageModel
{
public class HostSelectPageModel : BindableBase
{
private INavigationService _NavigationService;
private IBFFHService _BFFHService;
private IConnectionService _ConnectionService;
private readonly INavigationService _NavigationService;
private readonly IBFFHService _BFFHService;
public HostSelectPageModel(INavigationService navigationService, IBFFHService bffhService, IConnectionService connectionService)
public HostSelectPageModel(INavigationService navigationService, IBFFHService bffhService)
{
_NavigationService = navigationService;
_BFFHService = bffhService;
_ConnectionService = connectionService;
UseHostCommand = new Command(UseHostCommandExecuted);
DetectHostCommand = new Command(DetectHostCommandExecuted);
@ -63,7 +60,7 @@ namespace Borepin.PageModel
builder.Port = 59661;
}
Connection connection = new Connection()
Model.Connection connection = new Model.Connection()
{
Address = builder.Uri
};
@ -71,7 +68,7 @@ namespace Borepin.PageModel
await _BFFHService.Connect(connection);
INavigationResult result = await _NavigationService.NavigateAsync("LoginChoosePage");
if (!result.Success)
if(!result.Success)
{
System.Diagnostics.Debugger.Break();
}
@ -87,7 +84,7 @@ namespace Borepin.PageModel
private void DetectHostCommandExecuted()
{
// Use Demo Host
Host = "127.0.0.1:59661";
Host = "192.168.178.20:59661";
}
}
}

View File

@ -1,8 +1,5 @@
using Prism.Mvvm;
using Prism.Navigation;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;
using Xamarin.Forms;

View File

@ -1,11 +1,11 @@
using Borepin.Model;
using Borepin.Service.BFFH;
using Borepin.Service.Connections;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
namespace Borepin.PageModel
{
@ -21,7 +21,7 @@ namespace Borepin.PageModel
_BFFHService = bffhService;
_ConnectionService = connectionService;
AuthenticateCommand = new Command(AuthenticateCommandExecuted);
AuthenticateCommand = new DelegateCommand(async () => await AuthenticateCommandExecuted());
Task.Run(LoadData);
}
@ -52,17 +52,18 @@ namespace Borepin.PageModel
set => SetProperty(ref _AuthenticateCommand, value);
}
private async void AuthenticateCommandExecuted()
private async Task AuthenticateCommandExecuted()
{
Connection connection_update = _BFFHService.ActiveConnection;
connection_update.Username = Username;
await _BFFHService.Authenticate(connection_update, Password);
await _ConnectionService.AddConnection(_BFFHService.ActiveConnection);
await _ConnectionService.LogConnect(_BFFHService.ActiveConnection);
var result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachinesPage");
var result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage");
if (!result.Success)
{

View File

@ -0,0 +1,102 @@
using Borepin.ViewModel;
using Prism.Mvvm;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Input;
using Prism.Commands;
using Prism.Navigation;
using Borepin.Service.Connections;
using Borepin.Service.BFFH;
using Borepin.Model;
namespace Borepin.PageModel
{
public class MachineListPageModel : BindableBase, INavigationAware
{
private readonly INavigationService _NavigationService;
private readonly IConnectionService _ConnectionService;
private readonly IBFFHService _BFFHService;
public MachineListPageModel(INavigationService navigationService, IConnectionService connectionService, IBFFHService bffhService)
{
_NavigationService = navigationService;
_ConnectionService = connectionService;
_BFFHService = bffhService;
SelectInstanceCommand = new DelegateCommand<object>(SelectInstanceCommandExecuted);
}
private async Task<bool> LoadData()
{
if(_BFFHService.ActiveConnection == null)
{
return await Task.FromResult(true);
}
FabAccessAPI.Machines machineInterface = await _BFFHService.GetMachineInterface();
List<Machine> list = new List<Machine>();
IReadOnlyList<FabAccessAPI.Machine> machine_list = await machineInterface.ListMachines();
foreach(FabAccessAPI.Machine machine in machine_list)
{
list.Add(new Machine() { Instance = machine, MInfo = await machine.GetMInfo() });
}
List<MachineListItemViewModel> viewmodel_list = new List<MachineListItemViewModel>();
foreach(Machine machine in list)
{
viewmodel_list.Add(new MachineListItemViewModel(machine));
}
MachineListItemViewModel_List = viewmodel_list;
return await Task.FromResult(true);
}
#region Properties
private List<MachineListItemViewModel> _MachineListItemViewModel_List;
public List<MachineListItemViewModel> MachineListItemViewModel_List
{
get => _MachineListItemViewModel_List;
set => SetProperty(ref _MachineListItemViewModel_List, value);
}
#endregion
#region Commands
private ICommand _SelectInstanceCommand;
public ICommand SelectInstanceCommand
{
get => _SelectInstanceCommand;
set => SetProperty(ref _SelectInstanceCommand, value);
}
private async void SelectInstanceCommandExecuted(object obj)
{
MachineListItemViewModel viewmodel = obj as MachineListItemViewModel;
NavigationParameters parameters = new NavigationParameters
{
{ "instance", viewmodel.Instance }
};
INavigationResult result = await _NavigationService.NavigateAsync($"MachinePage", parameters);
if (!result.Success)
{
System.Diagnostics.Debugger.Break();
}
}
#endregion
#region INavigationAware
public void OnNavigatedFrom(INavigationParameters parameters)
{
}
public void OnNavigatedTo(INavigationParameters parameters)
{
Task.Run(LoadData);
}
#endregion
}
}

View File

@ -1,57 +1,64 @@
using Borepin.Model;
using Borepin.Service.BFFH;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using System.Windows.Input;
using Xamarin.Forms;
using static FabAccessAPI.Schema.Machine.WriteInterface;
namespace Borepin.PageModel
{
public class MachinePageModel : BindableBase, INavigationAware
{
private readonly INavigationService _NavigationService;
private readonly IBFFHService _BFFHService;
public MachinePageModel(INavigationService navigationService, IBFFHService bffhService)
public MachinePageModel(INavigationService navigationService)
{
_NavigationService = navigationService;
_BFFHService = bffhService;
ReserveMachineCommand = new Command(ReserveMachineCommandExecuted);
UseMachineCommand = new Command(UseMachineCommandExecuted);
GiveBackMachineCommand = new Command(GiveBackMachineCommandExecuted);
BlockMachineCommand = new Command(BlockMachineCommandExecuted);
DisableMachineCommand = new Command(DisableMachineCommandExecuted);
UseMachineCommand = new DelegateCommand(UseMachineCommandExecuted);
GiveBackMachineCommand = new DelegateCommand(GiveBackMachineCommandExecuted);
}
private Machine _Machine;
public Machine Machine
#region Properties
private Machine _MachineItem;
public Machine MachineItem
{
get => _Machine;
set => SetProperty(ref _Machine, value);
get => _MachineItem;
set => SetProperty(ref _MachineItem, value);
}
private bool _IsValid = false;
public bool IsValid
private string _Name;
public string Name
{
get => _IsValid;
set => SetProperty(ref _IsValid, value);
get => _Name;
set => SetProperty(ref _Name, value);
}
private ICommand _ReserveMachineCommand;
public ICommand ReserveMachineCommand
private IGiveBack _GiveBack;
//public IGiveBack GiveBack
//{
// get => _GiveBack;
// set => SetProperty(ref _GiveBack, value);
//}
private bool _CanUse;
public bool CanUse
{
get => _ReserveMachineCommand;
set => SetProperty(ref _ReserveMachineCommand, value);
get => _CanUse;
set => SetProperty(ref _CanUse, value);
}
private void ReserveMachineCommandExecuted()
private bool _CanGiveBack;
public bool CanGiveBack
{
//_BFFHInterface.ReserveMachine(Machine.ID);
//UpdateMachine();
get => _CanGiveBack;
set => SetProperty(ref _CanGiveBack, value);
}
#endregion
#region Commands
private ICommand _UseMachineCommand;
public ICommand UseMachineCommand
{
@ -59,10 +66,14 @@ namespace Borepin.PageModel
set => SetProperty(ref _UseMachineCommand, value);
}
private void UseMachineCommandExecuted()
private async void UseMachineCommandExecuted()
{
//_BFFHInterface.UseMachine(Machine.ID);
//UpdateMachine();
_GiveBack = await MachineItem.Instance.Use();
CanGiveBack = _GiveBack != null;
MachineItem.MInfo = await MachineItem.Instance.GetMInfo();
CanUse = MachineItem.MInfo.State == FabAccessAPI.Schema.State.free;
}
private ICommand _GiveBackMachineCommand;
@ -72,147 +83,21 @@ namespace Borepin.PageModel
set => SetProperty(ref _GiveBackMachineCommand, value);
}
private void GiveBackMachineCommandExecuted()
private async void GiveBackMachineCommandExecuted()
{
//_BFFHInterface.GiveBackMachine(Machine.ID);
//UpdateMachine();
await _GiveBack.Ret();
_GiveBack = null;
CanGiveBack = _GiveBack != null;
MachineItem.MInfo = await MachineItem.Instance.GetMInfo();
CanUse = MachineItem.MInfo.State == FabAccessAPI.Schema.State.free;
}
private ICommand _DisableMachineCommand;
public ICommand DisableMachineCommand
{
get => _DisableMachineCommand;
set => SetProperty(ref _DisableMachineCommand, value);
}
private void DisableMachineCommandExecuted()
{
//if(Machine.State == MachineStates.Disabled)
//{
// _BFFHInterface.SetStateForce(Machine.ID, MachineStates.Free);
//}
//else
//{
// _BFFHInterface.SetStateForce(Machine.ID, MachineStates.Disabled);
//}
//UpdateMachine();
}
private ICommand _BlockMachineCommand;
public ICommand BlockMachineCommand
{
get => _BlockMachineCommand;
set => SetProperty(ref _BlockMachineCommand, value);
}
private void BlockMachineCommandExecuted()
{
//if (Machine.State == MachineStates.Blocked)
//{
// _BFFHInterface.SetStateForce(Machine.ID, MachineStates.Free);
//}
//else
//{
// _BFFHInterface.SetStateForce(Machine.ID, MachineStates.Blocked);
//}
//UpdateMachine();
}
public bool CanUse
{
get
{
//if(Machine == null)
//{
// return false;
//}
//if(Machine.State == MachineStates.Free)
//{
// return true;
//}
//if(Machine.State == MachineStates.Reserved)
//{
// if(Machine.User == _BFFHInterface.ActiveUser)
// {
// return true;
// }
// else if(_BFFHInterface.IsAdmin())
// {
// return true;
// }
//}
return false;
}
}
public bool CanReserve
{
get
{
//if (Machine == null)
//{
// return false;
//}
//if (Machine.State == MachineStates.Free)
//{
// return true;
//}
return false;
}
}
public bool CanGiveBack
{
get
{
//if (Machine == null)
//{
// return false;
//}
//if (Machine.State == MachineStates.InUse && Machine.User == _BFFHInterface.ActiveUser)
//{
// return true;
//}
return false;
}
}
public bool IsAdmin
{
get
{
//if (_BFFHInterface == null)
//{
// return false;
//}
//if (_BFFHInterface.IsAdmin())
//{
// return true;
//}
return false;
}
}
public void UpdateMachine()
{
//Machine = BFFHService_OLD.GetMachine(Machine.ID);
//OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("CanUse"));
//OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("CanReserve"));
//OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("CanGiveBack"));
}
#endregion
#region INavigationAware
public void OnNavigatedFrom(INavigationParameters parameters)
{
@ -220,25 +105,13 @@ namespace Borepin.PageModel
public void OnNavigatedTo(INavigationParameters parameters)
{
//string machineID = parameters["machineID"] as string;
MachineItem = parameters["instance"] as Machine;
Name = MachineItem.MInfo.Name;
//if(machineID == null)
//{
// _IsValid = false;
// return;
//}
//try
//{
// Machine = BFFHService_OLD.GetMachine(machineID);
// IsValid = true;
// UpdateMachine();
//}
//catch
//{
// _IsValid = false;
//}
CanUse = MachineItem.MInfo.State == FabAccessAPI.Schema.State.free;
CanGiveBack = _GiveBack != null;
}
#endregion
}
}

View File

@ -1,50 +0,0 @@
using Borepin.Model;
using Prism.Mvvm;
using Prism.Navigation;
using System.Collections.ObjectModel;
using System.Windows.Input;
using Xamarin.Forms;
namespace Borepin.PageModel
{
public class MachinesPageModel : BindableBase
{
private readonly INavigationService _NavigationService;
public MachinesPageModel(INavigationService navigationService)
{
_NavigationService = navigationService;
GoToMachineCommand = new Command<object>(GoToMachineCommandExecuted);
}
private ICommand _GoToMachineCommand;
public ICommand GoToMachineCommand
{
get => _GoToMachineCommand;
set => SetProperty(ref _GoToMachineCommand, value);
}
private async void GoToMachineCommandExecuted(object obj)
{
Machine machine = obj as Machine;
NavigationParameters navigationParams = new NavigationParameters
{
{ "machineID", machine.ID }
};
INavigationResult result = await _NavigationService.NavigateAsync($"MachinePage", navigationParams);
if (!result.Success)
{
System.Diagnostics.Debugger.Break();
}
}
private ObservableCollection<Machine> _MachineList;
public ObservableCollection<Machine> MachineList
{
get => _MachineList;
set => SetProperty(ref _MachineList, value);
}
}
}

View File

@ -6,6 +6,7 @@ using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using Prism.Services.Dialogs;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Borepin.PageModel
@ -27,7 +28,7 @@ namespace Borepin.PageModel
_BFFHService = bffhService;
_CredentialService = credentialService;
ConnectCommand = new DelegateCommand(ConnectCommandExecuted);
ConnectCommand = new DelegateCommand(async () => await ConnectCommandExecuted());
DeleteCommand = new DelegateCommand(DeleteCommandExecuted);
}
@ -55,7 +56,7 @@ namespace Borepin.PageModel
set => SetProperty(ref _ConnectCommand, value);
}
private async void ConnectCommandExecuted()
private async Task ConnectCommandExecuted()
{
if(IsConnected)
{

View File

@ -3,12 +3,14 @@ using Borepin.Service.Credentials;
using System.Threading.Tasks;
using Capnp.Rpc;
using System.Collections.Generic;
using System.Threading;
using System;
namespace Borepin.Service.BFFH
{
public class BFFHService : IBFFHService
{
private ICredentialService _CredentialService;
private readonly ICredentialService _CredentialService;
private FabAccessAPI.Connection _Connection;
@ -32,13 +34,8 @@ namespace Borepin.Service.BFFH
rpcClient.Connect(connection.Address.Host, connection.Address.Port);
await Task.Run(async () =>
{
while (rpcClient.State == ConnectionState.Initializing)
{
await Task.Delay(100);
}
});
// IMPORTANT: without ConfigureAwait(false) every Call for CapnProto Runtime deadlocks on Android
await rpcClient.WhenConnected.ConfigureAwait(false);
FabAccessAPI.Connection connection_test = new FabAccessAPI.Connection(rpcClient);
@ -77,5 +74,10 @@ namespace Borepin.Service.BFFH
return await Task.FromResult(true);
}
public Task<FabAccessAPI.Machines> GetMachineInterface()
{
return _Connection.AccessMachines();
}
}
}

View File

@ -45,5 +45,7 @@ namespace Borepin.Service.BFFH
/// </summary>
/// <param name="connection">address + username</param>
Task<bool> Authenticate(Connection connection, string password);
Task<FabAccessAPI.Machines> GetMachineInterface();
}
}

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -0,0 +1,32 @@
<?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.MachineListItemView"
xmlns:pagemodel="clr-namespace:Borepin.PageModel"
xmlns:converters="clr-namespace:Borepin.Converter">
<ContentView.Resources>
<ResourceDictionary>
<converters:MachineStateColorConverter x:Key="MachineStateColorConverter"/>
<converters:MachineStateStringConverter x:Key="MachineStateStringConverter"/>
</ResourceDictionary>
</ContentView.Resources>
<ContentView.Content>
<Grid RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="1"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Name}" Style="{StaticResource LabelStyle_Primary}"/>
<Label Grid.Row="0" Grid.Column="2" Text="{Binding State, Converter={StaticResource MachineStateStringConverter}}" TextColor="{Binding State, Converter={StaticResource MachineStateColorConverter}}" Style="{StaticResource LabelStyle_Second}" HorizontalTextAlignment="End" />
<Button Grid.Row="0" Grid.Column="3" Margin="0, 3, 0, 3" Text="->" Command="{Binding Source={RelativeSource AncestorType={x:Type pagemodel:MachineListPageModel}}, Path=SelectInstanceCommand}" CommandParameter="{Binding .}" Style="{StaticResource ButtonStyle_Primary}"/>
<BoxView Grid.Row="1" Grid.ColumnSpan="5" BackgroundColor="{StaticResource FifthColor}"/>
</Grid>
</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 MachineListItemView : ContentView
{
public MachineListItemView()
{
InitializeComponent();
}
}
}

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View File

@ -0,0 +1,28 @@
using Borepin.Model;
using Prism.Mvvm;
namespace Borepin.ViewModel
{
public class ServerListItemViewModel : BindableBase
{
public ServerListItemViewModel(Connection instance)
{
_Instance = instance;
Address = instance.Address.ToString();
}
private Connection _Instance;
public Connection Instance
{
get => _Instance;
set => SetProperty(ref _Instance, value);
}
private string _Address;
public string Address
{
get => _Address;
set => SetProperty(ref _Address, value);
}
}
}

View File

@ -1,28 +1,36 @@
using Borepin.Model;
using Prism.Mvvm;
using Prism.Mvvm;
namespace Borepin.ViewModel
{
public class ServerListItemViewModel : BindableBase
public class MachineListItemViewModel : BindableBase
{
public ServerListItemViewModel(Connection instance)
public MachineListItemViewModel(Model.Machine instance)
{
_Instance = instance;
Address = instance.Address.ToString();
Name = instance.MInfo.Name;
State = instance.MInfo.State;
}
private Connection _Instance;
public Connection Instance
private Model.Machine _Instance;
public Model.Machine Instance
{
get => _Instance;
set => SetProperty(ref _Instance, value);
}
private string _Address;
public string Address
private string _Name;
public string Name
{
get => _Address;
set => SetProperty(ref _Address, value);
get => _Name;
set => SetProperty(ref _Name, value);
}
private FabAccessAPI.Schema.State _State;
public FabAccessAPI.Schema.State State
{
get => _State;
set => SetProperty(ref _State, value);
}
}
}

View File

@ -1,14 +1,12 @@
using Capnp;
using FabAccessAPI.Schema;
using FabAccessAPI.Schema;
using S22.Sasl;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Exception = System.Exception;
namespace FabAccessAPI {
namespace FabAccessAPI
{
/// Authentication Identity
///
/// Under the hood a string because the form depends heavily on the method

View File

@ -3,14 +3,14 @@ using FabAccessAPI.Schema;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace FabAccessAPI {
public class Connection {
#region private variables
private TcpRpcClient? _rpcClient = null;
private IBootstrap? _bootstrapCap = null;
private AuthUser? _authUser = null;
private readonly TcpRpcClient? _rpcClient = null;
private readonly IBootstrap? _bootstrapCap = null;
private Auth? _auth = null;
private Machines? _machines = null;
#endregion
@ -38,18 +38,18 @@ namespace FabAccessAPI {
/// <param name="mech">The desired authentication mechanism</param>
/// <param name="kvs">Key-Value data specific to the mechanism</param>
/// <returns></returns>
public async Task Auth(string mech, Dictionary<string, object> kvs) {
public async Task Auth(string mech, Dictionary<string, object> kvs, CancellationToken cancellationToken_ = default) {
// _bootstrapCap = await _bootstrapCap.Unwrap();
var authCap = await _bootstrapCap.Auth();
var authCap = await _bootstrapCap.Auth(cancellationToken_);
_auth = new Auth(authCap);
var mechs = await _auth.GetMechanisms().ConfigureAwait(false);
var mechs = await _auth.GetMechanisms();
_Log.Debug($"The Server supports the following auth mechs: {string.Join(", ", mechs)}");
if (!mechs.Contains(mech)) {
throw new UnsupportedMechanismException();
}
await _auth.Authenticate(mech, kvs).ConfigureAwait(false);
await _auth.Authenticate(mech, kvs);
}
/// <summary>
@ -57,7 +57,7 @@ namespace FabAccessAPI {
/// </summary>
/// <returns>A wrapped capability to interact with machines</returns>
public async Task<Machines> AccessMachines() {
_machines ??= new Machines((await _bootstrapCap.Machines().ConfigureAwait(false)));
_machines ??= new Machines(await _bootstrapCap.Machines());
return _machines;
}
}

View File

@ -1,10 +1,10 @@
using FabAccessAPI.Schema;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace FabAccessAPI {
namespace FabAccessAPI
{
public class MachineException : Exception { }
@ -12,12 +12,8 @@ namespace FabAccessAPI {
/// Wraps a capability for accessing the Machines subsystem of BFFH
/// </summary>
public class Machines {
#region Log
private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
private IMachines _machinesCap;
private readonly IMachines _machinesCap;
/// <summary>
/// Constructs the Wrapper Class from a given capability.
@ -31,8 +27,16 @@ namespace FabAccessAPI {
/// List of all machines that BFFH knows about the user has been granted at least read access on
/// </summary>
/// <returns>ReadOnlyList of available Machines</returns>
public async Task<IReadOnlyList<Machine>?> ListMachines() {
return (await _machinesCap.ListMachines().ConfigureAwait(false)).Select(x => new Machine(x)) as IReadOnlyList<Machine>;
public async Task<IReadOnlyList<Machine>?> ListMachines()
{
IReadOnlyList<Schema.Machine>? machineList = await _machinesCap.ListMachines().ConfigureAwait(false);
List<Machine> machineList_new = new List<Machine>();
foreach(Schema.Machine machine in machineList)
{
machineList_new.Add(new Machine(machine));
}
return machineList_new;
}
/// <summary>
@ -63,7 +67,7 @@ namespace FabAccessAPI {
/// even have `read` set and are unable to even see if the machine is currently in use.
/// </summary>
public class Machine {
private Schema.Machine _machine;
private readonly Schema.Machine _machine;
/// <summary>
/// Constructs the Wrapper Class from a given capability

View File

@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
//This is where the permissions subsystem will live
namespace FabAccessAPI {
//This is where the permissions subsystem will live
namespace FabAccessAPI
{
public class Permissions {
#region Log
private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -1,84 +0,0 @@
using Capnp.Rpc;
using NUnit.Framework;
using System;
namespace FabAccessAPI_Test
{
public class ConnectionTest
{
[Test, Repeat(10)]
public void IPv4()
{
UriBuilder builder = new UriBuilder();
builder.Host = "127.0.0.1";
builder.Port = 59661;
Uri uri = builder.Uri;
TcpRpcClient rpcClient = new TcpRpcClient();
rpcClient.Connect(uri.Host, uri.Port);
while (rpcClient.State == ConnectionState.Initializing);
FabAccessAPI.Connection connection = new FabAccessAPI.Connection(rpcClient);
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
rpcClient.Dispose();
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
}
[Test, Repeat(10)]
public void IPv6()
{
UriBuilder builder = new UriBuilder();
builder.Host = "[::1]";
builder.Port = 59661;
Uri uri = builder.Uri;
TcpRpcClient rpcClient = new TcpRpcClient();
rpcClient.Connect(uri.Host, uri.Port);
while (rpcClient.State == ConnectionState.Initializing) ;
FabAccessAPI.Connection connection = new FabAccessAPI.Connection(rpcClient);
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
rpcClient.Dispose();
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
}
[Test, Repeat(10)]
public void DoubleConnect()
{
TcpRpcClient rpcClient = new TcpRpcClient();
rpcClient.Connect("127.0.0.1", 59661);
while (rpcClient.State == ConnectionState.Initializing) ;
FabAccessAPI.Connection connection = new FabAccessAPI.Connection(rpcClient);
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
rpcClient.Dispose();
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
rpcClient = new TcpRpcClient();
rpcClient.Connect("127.0.0.1", 59661);
connection = new FabAccessAPI.Connection(rpcClient);
while (rpcClient.State == ConnectionState.Initializing) ;
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
rpcClient.Dispose();
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
}
}
}

View File

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using NUnit.Framework;
@ -7,6 +6,7 @@ using Capnp;
using Capnp.Rpc;
using log4net.Config;
using Microsoft.Extensions.Logging;
using static FabAccessAPI.Schema.Machine.WriteInterface;
namespace FabAccessAPI_Test {
public class Tests {
@ -31,7 +31,7 @@ namespace FabAccessAPI_Test {
[SetUp]
public void Setup() {
var rpcClient = new TcpRpcClient();
TcpRpcClient rpcClient = new TcpRpcClient();
rpcClient.Connect("[::1]", 59661);
_connection = new Connection(rpcClient);
}
@ -53,15 +53,48 @@ namespace FabAccessAPI_Test {
}
[Test]
public async Task Machines() {
public async Task GetMInfo() {
await _connection.Auth("PLAIN", new Dictionary<string, object>{{"Username", "Testuser"}, {"Password", "secret"}});
var machines = await _connection.AccessMachines();
var testmachine = await machines.GetMachine("Testmachine");
Machines machines = await _connection.AccessMachines();
Machine testmachine = await machines.GetMachine("Testmachine");
Assert.NotNull(testmachine);
var minfo = await testmachine.GetMInfo();
FabAccessAPI.Schema.Machine.MInfo minfo = await testmachine.GetMInfo();
Assert.NotNull(minfo);
_Log.Info($"Name: {minfo.Name}, Description: {minfo.Description}, State: {minfo.State}");
}
[Test]
public async Task ListMachines()
{
await _connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", "Testuser" }, { "Password", "secret" } });
Machines machines = await _connection.AccessMachines();
IReadOnlyList<Machine> machineList = await machines.ListMachines();
Assert.NotNull(machineList);
Assert.AreNotEqual(0, machineList.Count);
}
[Test]
public async Task UseMachine()
{
await _connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", "Testuser" }, { "Password", "secret" } });
Machines machines = await _connection.AccessMachines();
Machine testmachine = await machines.GetMachine("Testmachine");
Assert.NotNull(testmachine);
await testmachine.Use();
FabAccessAPI.Schema.Machine.MInfo minfo = await testmachine.GetMInfo();
Assert.NotNull(minfo);
Assert.AreEqual(FabAccessAPI.Schema.State.inUse, minfo.State);
//await giveBack.Ret();
//minfo = await testmachine.GetMInfo();
//Assert.NotNull(minfo);
//Assert.AreEqual(FabAccessAPI.Schema.State.free, minfo.State);
}
}
}

View File

@ -9,8 +9,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
</ItemGroup>
<ItemGroup>

View File

@ -8,6 +8,6 @@
<PackageReference Include="log4net" Version="2.0.12" />
<PackageReference Include="PCSC" Version="5.0.0" />
<PackageReference Include="PCSC.Iso7816" Version="5.0.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.8" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.9" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,4 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Text;
namespace NFC_Unit_Test.Crypto
{