mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-15 22:56:37 +01:00
33 lines
966 B
C#
33 lines
966 B
C#
|
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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|