mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-07-14 06:26:36 +02:00
Initial version.
This commit is contained in:
parent
e4fb48f6ab
commit
10dbeb5a90
737 changed files with 61885 additions and 0 deletions
32
TINK/TINK.UWP/Device/WinPhoneDevice .cs
Normal file
32
TINK/TINK.UWP/Device/WinPhoneDevice .cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using TINK.Model.Device;
|
||||
using TINK.UWP.Device;
|
||||
using Windows.System.Profile;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
[assembly: Xamarin.Forms.Dependency(typeof(WinPhoneDevice))]
|
||||
namespace TINK.UWP.Device
|
||||
{
|
||||
public class WinPhoneDevice : IDevice
|
||||
{
|
||||
/// <summary> Gets unitque device identifier. </summary>
|
||||
/// <returns>Gets the identifies specifying device.</returns>
|
||||
public string GetIdentifier()
|
||||
{
|
||||
var token = HardwareIdentification.GetPackageSpecificToken(null);
|
||||
var hardwareId = token.Id;
|
||||
var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId);
|
||||
|
||||
byte[] bytes = new byte[hardwareId.Length];
|
||||
dataReader.ReadBytes(bytes);
|
||||
|
||||
return BitConverter.ToString(bytes);
|
||||
}
|
||||
|
||||
/// <summary> Close the application. </summary>
|
||||
public void CloseApplication()
|
||||
{
|
||||
Application.Current.Exit();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue