Revert "Adding the initial work to get Tizen started. #23"
This reverts commit 58b6041d5f
.
This commit is contained in:
Родитель
58b6041d5f
Коммит
8056f53f50
|
@ -1,21 +0,0 @@
|
|||
using Xamarin.Forms.Platform.Tizen;
|
||||
|
||||
namespace Samples.Tizen
|
||||
{
|
||||
class Program : FormsApplication
|
||||
{
|
||||
protected override void OnCreate()
|
||||
{
|
||||
base.OnCreate();
|
||||
|
||||
LoadApplication(new App());
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var app = new Program();
|
||||
Forms.Init(app);
|
||||
app.Run(args);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>tizen40</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugType>portable</DebugType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>None</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Tizen.NET" Version="4.0.0" ExcludeAssets="Runtime" />
|
||||
<PackageReference Include="Tizen.NET.Sdk" Version="1.0.1" />
|
||||
<PackageReference Include="Xamarin.Forms.Platform.Tizen" Version="2.5.0.280555" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj" />
|
||||
<ProjectReference Include="..\Samples\Samples.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="lib\" />
|
||||
<Folder Include="res\" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\..\CodeStyles.targets" />
|
||||
</Project>
|
Двоичные данные
Samples/Samples.Tizen/shared/res/Samples.Tizen.png
Двоичные данные
Samples/Samples.Tizen/shared/res/Samples.Tizen.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 5.9 KiB |
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="com.xamarin.essentials" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages">
|
||||
<profile name="common" />
|
||||
<ui-application appid="com.xamarin.essentials" exec="Samples.Tizen.dll" multiple="false" nodisplay="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
|
||||
<label>Xamarin.Essentials</label>
|
||||
<icon>Samples.Tizen.png</icon>
|
||||
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
|
||||
</ui-application>
|
||||
<privileges>
|
||||
<privilege>http://tizen.org/privilege/appmanager.launch</privilege>
|
||||
</privileges>
|
||||
<provides-appdefined-privileges />
|
||||
</manifest>
|
|
@ -39,8 +39,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceTests.iOS", "DeviceTe
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceTests.UWP", "DeviceTests\DeviceTests.UWP\DeviceTests.UWP.csproj", "{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Tizen", "Samples\Samples.Tizen\Samples.Tizen.csproj", "{4B1850CF-C568-4C16-8B42-3E9977DE5F56}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
DeviceTests\DeviceTests.Shared\DeviceTests.Shared.projitems*{4bd0d88f-7e7a-4c3b-9e34-bf3717a8ff4b}*SharedItemsImports = 4
|
||||
|
@ -327,30 +325,6 @@ Global
|
|||
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Release|x86.ActiveCfg = Release|x86
|
||||
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Release|x86.Build.0 = Release|x86
|
||||
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Release|x86.Deploy.0 = Release|x86
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -366,7 +340,6 @@ Global
|
|||
{CB2072E0-A437-4811-AE17-16CAE0DDA1B1} = {EA9AC363-45BC-4959-BD17-FE3A1B724529}
|
||||
{EE8FC716-27FC-405B-BD27-AF17E01A6671} = {EA9AC363-45BC-4959-BD17-FE3A1B724529}
|
||||
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B} = {EA9AC363-45BC-4959-BD17-FE3A1B724529}
|
||||
{4B1850CF-C568-4C16-8B42-3E9977DE5F56} = {706C0487-6930-4E55-8720-C17D9FE6CA91}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {105B0052-C7EA-44D0-8697-37A45E1392AF}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Accelerometer
|
||||
{
|
||||
internal static bool IsSupported =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void PlatformStart(SensorSpeed sensorSpeed) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void PlatformStop() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
using System.Globalization;
|
||||
using Tizen.Applications;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class AppInfo
|
||||
{
|
||||
static string GetPackageName()
|
||||
=> Application.Current.ApplicationInfo.PackageId;
|
||||
|
||||
static string GetName()
|
||||
=> Application.Current.ApplicationInfo.Label;
|
||||
|
||||
static string GetVersionString()
|
||||
{
|
||||
try
|
||||
{
|
||||
var packageId = Application.Current.ApplicationInfo.PackageId;
|
||||
return PackageManager.GetPackage(packageId).Version;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
static string GetBuild()
|
||||
=> Version.Build.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Battery
|
||||
{
|
||||
static void StartBatteryListeners() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void StopBatteryListeners() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static double PlatformChargeLevel =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static BatteryState PlatformState =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static BatteryPowerSource PlatformPowerSource =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Browser
|
||||
{
|
||||
static Task PlatformOpenAsync(Uri uri, BrowserLaunchType launchType) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Clipboard
|
||||
{
|
||||
static void PlatformSetText(string text)
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static bool PlatformHasText
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task<string> PlatformGetTextAsync()
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Compass
|
||||
{
|
||||
internal static bool IsSupported =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
internal static void PlatformStart(SensorSpeed sensorSpeed) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
internal static void PlatformStop() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Connectivity
|
||||
{
|
||||
static NetworkAccess PlatformNetworkAccess =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static IEnumerable<ConnectionProfile> PlatformProfiles =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void StartListeners() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void StopListeners() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class DataTransfer
|
||||
{
|
||||
static Task PlatformRequestAsync(ShareTextRequest request) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class DeviceDisplay
|
||||
{
|
||||
static ScreenMetrics GetScreenMetrics() => throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void StartScreenMetricsListeners() => throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void StopScreenMetricsListeners() => throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -29,7 +29,6 @@ namespace Xamarin.Essentials
|
|||
public const string Tablet = "Tablet";
|
||||
public const string Desktop = "Desktop";
|
||||
public const string TV = "TV";
|
||||
public const string Watch = "Watch";
|
||||
|
||||
public const string Unsupported = "Unsupported";
|
||||
}
|
||||
|
@ -42,7 +41,6 @@ namespace Xamarin.Essentials
|
|||
public const string iOS = "iOS";
|
||||
public const string Android = "Android";
|
||||
public const string UWP = "UWP";
|
||||
public const string Tizen = "Tizen";
|
||||
|
||||
public const string Unsupported = "Unsupported";
|
||||
}
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
using Plat = Xamarin.Essentials.Platform;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class DeviceInfo
|
||||
{
|
||||
static string GetModel()
|
||||
=> Plat.GetSystemInfo("model_name");
|
||||
|
||||
static string GetManufacturer()
|
||||
=> Plat.GetSystemInfo("manufacturer");
|
||||
|
||||
static string GetDeviceName()
|
||||
=> Plat.GetSystemInfo("device_name");
|
||||
|
||||
static string GetVersionString()
|
||||
=> Plat.GetFeatureInfo("platform.version");
|
||||
|
||||
static string GetPlatform()
|
||||
=> Platforms.Tizen;
|
||||
|
||||
static string GetIdiom()
|
||||
{
|
||||
var profile = Plat.GetFeatureInfo("profile")?.ToUpperInvariant();
|
||||
|
||||
if (profile == null)
|
||||
return Idioms.Unsupported;
|
||||
|
||||
if (profile.StartsWith("M"))
|
||||
return Idioms.Phone;
|
||||
else if (profile.StartsWith("W"))
|
||||
return Idioms.Watch;
|
||||
else if (profile.StartsWith("T"))
|
||||
return Idioms.TV;
|
||||
else
|
||||
return Idioms.Unsupported;
|
||||
|
||||
// if (profile.StartsWith("I"))
|
||||
// return Idioms.Car;
|
||||
}
|
||||
|
||||
static DeviceType GetDeviceType()
|
||||
{
|
||||
var arch = Plat.GetFeatureInfo("platform.core.cpu.arch");
|
||||
var armv7 = Plat.GetFeatureInfo<bool>("platform.core.cpu.arch.armv7");
|
||||
var x86 = Plat.GetFeatureInfo<bool>("platform.core.cpu.arch.x86");
|
||||
|
||||
if (arch != null && arch.Equals("armv7") && armv7 && !x86)
|
||||
return DeviceType.Physical;
|
||||
else if (arch != null && arch.Equals("x86") && !armv7 && x86)
|
||||
return DeviceType.Virtual;
|
||||
else
|
||||
return DeviceType.Virtual;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Email
|
||||
{
|
||||
internal static bool IsComposeSupported =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task PlatformComposeAsync(EmailMessage message) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class FileSystem
|
||||
{
|
||||
static string PlatformCacheDirectory
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static string PlatformAppDataDirectory
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task<Stream> PlatformOpenAppPackageFileAsync(string filename)
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Flashlight
|
||||
{
|
||||
static Task PlatformTurnOnAsync() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task PlatformTurnOffAsync() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Geocoding
|
||||
{
|
||||
static Task<IEnumerable<Placemark>> PlatformGetPlacemarksAsync(double latitude, double longitude) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task<IEnumerable<Location>> PlatformGetLocationsAsync(string address) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Geolocation
|
||||
{
|
||||
static Task<Location> PlatformLastKnownLocationAsync() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task<Location> PlatformLocationAsync(GeolocationRequest request, CancellationToken cancellationToken) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Gyroscope
|
||||
{
|
||||
internal static bool IsSupported =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
internal static void PlatformStart(SensorSpeed sensorSpeed) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
internal static void PlatformStop() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Magnetometer
|
||||
{
|
||||
internal static bool IsSupported =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
internal static void PlatformStart(SensorSpeed sensorSpeed) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
internal static void PlatformStop() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
internal static partial class Permissions
|
||||
{
|
||||
static void PlatformEnsureDeclared(PermissionType permission) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task<PermissionStatus> PlatformCheckStatusAsync(PermissionType permission) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task<PermissionStatus> PlatformRequestAsync(PermissionType permission) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class PhoneDialer
|
||||
{
|
||||
internal static bool IsSupported =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void PlatformOpen(string number) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
using System;
|
||||
using ElmSharp;
|
||||
using Tizen.System;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Platform
|
||||
{
|
||||
static void PlatformBeginInvokeOnMainThread(Action action)
|
||||
{
|
||||
if (EcoreMainloop.IsMainThread)
|
||||
action();
|
||||
else
|
||||
EcoreMainloop.PostAndWakeUp(action);
|
||||
}
|
||||
|
||||
internal static string GetSystemInfo(string item)
|
||||
{
|
||||
Information.TryGetValue<string>($"http://tizen.org/system/{item}", out var value);
|
||||
return value;
|
||||
}
|
||||
|
||||
internal static T GetSystemInfo<T>(string item)
|
||||
{
|
||||
Information.TryGetValue<T>($"http://tizen.org/system/{item}", out var value);
|
||||
return value;
|
||||
}
|
||||
|
||||
internal static string GetFeatureInfo(string item)
|
||||
{
|
||||
Information.TryGetValue<string>($"http://tizen.org/feature/{item}", out var value);
|
||||
return value;
|
||||
}
|
||||
|
||||
internal static T GetFeatureInfo<T>(string item)
|
||||
{
|
||||
Information.TryGetValue<T>($"http://tizen.org/feature/{item}", out var value);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
using System.Linq;
|
||||
using Tizen.Applications;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Preferences
|
||||
{
|
||||
const string separator = "~";
|
||||
|
||||
static readonly object locker = new object();
|
||||
|
||||
static bool PlatformContainsKey(string key, string sharedName)
|
||||
{
|
||||
lock (locker)
|
||||
{
|
||||
return Preference.Contains(GetFullKey(key, sharedName));
|
||||
}
|
||||
}
|
||||
|
||||
static void PlatformRemove(string key, string sharedName)
|
||||
{
|
||||
lock (locker)
|
||||
{
|
||||
var fullKey = GetFullKey(key, sharedName);
|
||||
if (Preference.Contains(fullKey))
|
||||
Preference.Remove(fullKey);
|
||||
}
|
||||
}
|
||||
|
||||
static void PlatformClear(string sharedName)
|
||||
{
|
||||
lock (locker)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sharedName))
|
||||
{
|
||||
Preference.RemoveAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
var keys = Preference.Keys.Where(key => key.StartsWith($"{sharedName}{separator}")).ToList();
|
||||
foreach (var key in keys)
|
||||
Preference.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void PlatformSet<T>(string key, T value, string sharedName)
|
||||
{
|
||||
lock (locker)
|
||||
{
|
||||
var fullKey = GetFullKey(key, sharedName);
|
||||
if (value == null)
|
||||
Preference.Remove(fullKey);
|
||||
else
|
||||
Preference.Set(fullKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
static T PlatformGet<T>(string key, T defaultValue, string sharedName)
|
||||
{
|
||||
lock (locker)
|
||||
{
|
||||
var value = defaultValue;
|
||||
var fullKey = GetFullKey(key, sharedName);
|
||||
if (Preference.Contains(fullKey))
|
||||
{
|
||||
switch (defaultValue)
|
||||
{
|
||||
case int i:
|
||||
case bool b:
|
||||
case long l:
|
||||
case double d:
|
||||
case float f:
|
||||
case string s:
|
||||
value = Preference.Get<T>(fullKey);
|
||||
break;
|
||||
default:
|
||||
// the case when the string is null
|
||||
if (typeof(T) == typeof(string))
|
||||
value = (T)(object)Preference.Get<string>(fullKey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
static string GetFullKey(string key, string sharedName = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sharedName))
|
||||
return key;
|
||||
return $"{sharedName}{separator}{key}";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class ScreenLock
|
||||
{
|
||||
static bool PlatformIsActive
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void PlatformRequestActive()
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void PlatformRequestRelease()
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public partial class SecureStorage
|
||||
{
|
||||
static Task<string> PlatformGetAsync(string key) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task PlatformSetAsync(string key, string data) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Sms
|
||||
{
|
||||
internal static bool IsComposeSupported
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static Task PlatformComposeAsync(SmsMessage message)
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class TextToSpeech
|
||||
{
|
||||
internal static Task PlatformSpeakAsync(string text, SpeakSettings settings, CancellationToken cancelToken = default) =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
internal static Task<IEnumerable<Locale>> PlatformGetLocalesAsync() =>
|
||||
throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Xamarin.Essentials
|
||||
{
|
||||
public static partial class Vibration
|
||||
{
|
||||
internal static bool IsSupported
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void PlatformVibrate(TimeSpan duration)
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
|
||||
static void PlatformCancel()
|
||||
=> throw new NotImplementedInReferenceAssemblyException();
|
||||
}
|
||||
}
|
|
@ -2,8 +2,8 @@
|
|||
<PropertyGroup>
|
||||
<!--Work around so the conditions work below-->
|
||||
<TargetFrameworks></TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">netstandard1.0;netstandard2.0;Xamarin.iOS10;MonoAndroid71;uap10.0.16299;tizen40;</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.0;netstandard2.0;Xamarin.iOS10;MonoAndroid71;tizen40;</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">netstandard1.0;netstandard2.0;Xamarin.iOS10;MonoAndroid71;uap10.0.16299</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.0;netstandard2.0;Xamarin.iOS10;MonoAndroid71;</TargetFrameworks>
|
||||
<AssemblyName>Xamarin.Essentials</AssemblyName>
|
||||
<RootNamespace>Xamarin.Essentials</RootNamespace>
|
||||
<PackageId>Xamarin.Essentials</PackageId>
|
||||
|
@ -59,6 +59,7 @@
|
|||
<Compile Include="**\*.uwp.*.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
|
||||
|
||||
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="25.4.0.2" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="25.4.0.2" />
|
||||
<Reference Include="System.Numerics" />
|
||||
|
@ -72,12 +73,6 @@
|
|||
<Compile Include="**\*.ios.cs" />
|
||||
<Compile Include="**\*.ios.*.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" $(TargetFramework.StartsWith('tizen')) ">
|
||||
<PackageReference Include="Tizen.NET" Version="4.0.0" />
|
||||
<PackageReference Include="System.Numerics.Vectors" Version="4.4.0" />
|
||||
<Compile Include="**\*.tizen.cs" />
|
||||
<Compile Include="**\*.tizen.*.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)mdoc.targets" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\CodeStyles.targets" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче