This commit is contained in:
Matthew Leibowitz 2020-03-11 00:03:36 +02:00
Родитель 29a2e80889
Коммит 4df3fac543
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 00A672181E6BF432
66 изменённых файлов: 107 добавлений и 479 удалений

Просмотреть файл

@ -59,8 +59,8 @@
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="2.1.1" />
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.5.0.356" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />

Просмотреть файл

@ -14,7 +14,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
@ -33,7 +33,8 @@
<XamMacArch></XamMacArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
@ -49,43 +50,26 @@
<HttpClientHandler></HttpClientHandler>
<XamMacArch></XamMacArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Samples|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Samples</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>true</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>true</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<LinkMode>SdkOnly</LinkMode>
<HttpClientHandler></HttpClientHandler>
<XamMacArch></XamMacArch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Mac" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AppCenter" Version="1.13.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="1.13.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="1.13.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="1.13.0" />
<PackageReference Include="Xamarin.Forms" Version="3.5.0.129452" />
<PackageReference Include="Microsoft.AppCenter" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="2.1.1" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj">
<Project>{63a4f6a1-48bf-4d32-aed7-82f605edb043}</Project>
<Project>{CD6D6AE6-83A1-41B1-BD7C-C555A77C288B}</Project>
<Name>Xamarin.Essentials</Name>
</ProjectReference>
<ProjectReference Include="..\Samples\Samples.csproj">
<Project>{2550ED91-8AE1-4E9A-A964-C11515C8FA28}</Project>
<Project>{B4227123-2EEB-494A-A221-C061B5659AED}</Project>
<Name>Samples</Name>
</ProjectReference>
</ItemGroup>
@ -118,5 +102,4 @@
<BundleResource Include="Resources\FileSystemTemplate.txt" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\..\CodeStyles.targets" />
</Project>

Просмотреть файл

@ -119,8 +119,8 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="2.1.1" />
<PackageReference Include="Xamarin.Forms" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.5.0.356" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>

Просмотреть файл

@ -76,17 +76,17 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="2.1.1" />
<PackageReference Include="Xamarin.Forms" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.5.0.356" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj">
<Project>{63a4f6a1-48bf-4d32-aed7-82f605edb042}</Project>
<Project>{CD6D6AE6-83A1-41B1-BD7C-C555A77C288B}</Project>
<Name>Xamarin.Essentials</Name>
</ProjectReference>
<ProjectReference Include="..\Samples\Samples.csproj">
<Project>{045E53B5-3E59-4497-B996-EF6732E33ED5}</Project>
<Project>{B4227123-2EEB-494A-A221-C061B5659AED}</Project>
<Name>Samples</Name>
</ProjectReference>
</ItemGroup>

Просмотреть файл

@ -15,8 +15,8 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="2.1.1" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="2.1.1" />
<PackageReference Include="Xamarin.Forms" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.3.0.947036" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.5.0.356" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>

Просмотреть файл

@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29505.209
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Essentials", "Xamarin.Essentials\Xamarin.Essentials.csproj", "{CD6D6AE6-83A1-41B1-BD7C-C555A77C288B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Essentials", "Xamarin.Essentials\Xamarin.Essentials.csproj", "{CD6D6AE6-83A1-41B1-BD7C-C555A77C288B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples", "Samples\Samples\Samples.csproj", "{B4227123-2EEB-494A-A221-C061B5659AED}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples", "Samples\Samples\Samples.csproj", "{B4227123-2EEB-494A-A221-C061B5659AED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Android", "Samples\Samples.Android\Samples.Android.csproj", "{3C0CDEF3-495E-45F4-8B12-0E05EF11295C}"
EndProject
@ -31,6 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{EE4495FA
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Server.WebAuthenticator", "Samples\Sample.Server.WebAuthenticator\Sample.Server.WebAuthenticator.csproj", "{553D51A8-8E79-40D9-9FB3-9FC2386FF886}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Mac", "Samples\Samples.Mac\Samples.Mac.csproj", "{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -465,6 +467,34 @@ Global
{553D51A8-8E79-40D9-9FB3-9FC2386FF886}.Release|x64.Build.0 = Release|Any CPU
{553D51A8-8E79-40D9-9FB3-9FC2386FF886}.Release|x86.ActiveCfg = Release|Any CPU
{553D51A8-8E79-40D9-9FB3-9FC2386FF886}.Release|x86.Build.0 = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|ARM.ActiveCfg = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|ARM.Build.0 = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|ARM64.Build.0 = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|iPhone.Build.0 = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|x64.ActiveCfg = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|x64.Build.0 = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|x86.ActiveCfg = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Debug|x86.Build.0 = Debug|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|Any CPU.Build.0 = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|ARM.ActiveCfg = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|ARM.Build.0 = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|ARM64.ActiveCfg = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|ARM64.Build.0 = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|iPhone.ActiveCfg = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|iPhone.Build.0 = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|x64.ActiveCfg = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|x64.Build.0 = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|x86.ActiveCfg = Release|Any CPU
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -481,6 +511,7 @@ Global
{EE8FC716-27FC-405B-BD27-AF17E01A6671} = {EE4495FA-9869-45CF-A11D-69F2218C6F62}
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B} = {EE4495FA-9869-45CF-A11D-69F2218C6F62}
{553D51A8-8E79-40D9-9FB3-9FC2386FF886} = {6330A0D0-E784-42A6-B975-451E609B907B}
{89899D16-4BD1-49B1-9903-9F6BB26C5DC5} = {6330A0D0-E784-42A6-B975-451E609B907B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E012047E-6826-4037-8D1A-5606CD7D345D}

Просмотреть файл

@ -1,14 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Accelerometer
{
internal static bool IsSupported =>
throw new System.PlatformNotSupportedException();
static void PlatformStart(SensorSpeed sensorSpeed) =>
throw new System.PlatformNotSupportedException();
static void PlatformStop() =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,5 +1,7 @@
using Foundation;
#if __IOS__ || __TVOS__
using UIKit;
#endif
namespace Xamarin.Essentials
{

Просмотреть файл

@ -1,20 +0,0 @@
using System;
using Foundation;
namespace Xamarin.Essentials
{
public static partial class AppInfo
{
static string PlatformGetPackageName() => GetBundleValue("CFBundleIdentifier");
static string PlatformGetName() => GetBundleValue("CFBundleDisplayName") ?? GetBundleValue("CFBundleName");
static string PlatformGetVersionString() => GetBundleValue("CFBundleShortVersionString");
static string PlatformGetBuild() => GetBundleValue("CFBundleVersion");
static string GetBundleValue(string key) => NSBundle.MainBundle.ObjectForInfoDictionary(key)?.ToString();
static void PlatformShowSettingsUI() => throw new PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,3 +0,0 @@
using Foundation;
[assembly: LinkerSafe]

Просмотреть файл

@ -1,14 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Barometer
{
internal static bool IsSupported =>
throw new System.PlatformNotSupportedException();
internal static void PlatformStart(SensorSpeed sensorSpeed) =>
throw new System.PlatformNotSupportedException();
internal static void PlatformStop() =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -25,5 +25,11 @@ namespace Xamarin.Essentials
static Task<string> PlatformGetTextAsync() =>
Task.FromResult(Pasteboard.GetStringForType(pasteboardType));
static void StartClipboardListeners()
=> throw ExceptionUtils.NotSupportedOrImplementedException;
static void StopClipboardListeners()
=> throw ExceptionUtils.NotSupportedOrImplementedException;
}
}

Просмотреть файл

@ -1,14 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Compass
{
internal static bool IsSupported =>
throw new System.PlatformNotSupportedException();
internal static void PlatformStart(SensorSpeed sensorSpeed, bool applyLowPassFilter) =>
throw new System.PlatformNotSupportedException();
internal static void PlatformStop() =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,7 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Connectivity
{
// macOS code is exactly the same as iOS, so we use that file directly.
}
}

Просмотреть файл

@ -1,13 +0,0 @@
using System.Threading.Tasks;
namespace Xamarin.Essentials
{
public static partial class Email
{
internal static bool IsComposeSupported =>
throw new System.PlatformNotSupportedException();
static Task PlatformComposeAsync(EmailMessage message) =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,41 +0,0 @@
using System.IO;
using System.Threading.Tasks;
using Foundation;
using MobileCoreServices;
namespace Xamarin.Essentials
{
public static partial class FileSystem
{
static string PlatformCacheDirectory
=> throw new System.PlatformNotSupportedException();
static string PlatformAppDataDirectory
=> throw new System.PlatformNotSupportedException();
static Task<Stream> PlatformOpenAppPackageFileAsync(string filename)
=> throw new System.PlatformNotSupportedException();
}
public partial class FileBase
{
internal FileBase(NSUrl file)
: this(NSFileManager.DefaultManager.DisplayName(file?.Path))
{
}
internal static string PlatformGetContentType(string extension)
{
// ios does not like the extensions
extension = extension?.TrimStart('.');
var id = UTType.CreatePreferredIdentifier(UTType.TagClassFilenameExtension, extension, null);
var mimeTypes = UTType.CopyAllTags(id, UTType.TagClassMIMEType);
return mimeTypes.Length > 0 ? mimeTypes[0] : null;
}
internal void PlatformInit(FileBase file)
{
}
}
}

Просмотреть файл

@ -1,13 +0,0 @@
using System.Threading.Tasks;
namespace Xamarin.Essentials
{
public static partial class Flashlight
{
static Task PlatformTurnOnAsync() =>
throw new System.PlatformNotSupportedException();
static Task PlatformTurnOffAsync() =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,7 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Geocoding
{
// macOS code is exactly the same as iOS, so we use that file directly.
}
}

Просмотреть файл

@ -1,7 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Geolocation
{
// macOS code is exactly the same as iOS, so we use that file directly.
}
}

Просмотреть файл

@ -1,14 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Gyroscope
{
internal static bool IsSupported =>
throw new System.PlatformNotSupportedException();
internal static void PlatformStart(SensorSpeed sensorSpeed) =>
throw new System.PlatformNotSupportedException();
internal static void PlatformStop() =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using AppKit;
using Foundation;
@ -8,9 +9,39 @@ namespace Xamarin.Essentials
public static partial class Launcher
{
static Task<bool> PlatformCanOpenAsync(Uri uri) =>
Task.FromResult(NSWorkspace.SharedWorkspace.UrlForApplication(new NSUrl(uri.AbsoluteUri)) != null);
Task.FromResult(NSWorkspace.SharedWorkspace.UrlForApplication(GetNativeUrl(uri)) != null);
static Task PlatformOpenAsync(Uri uri) =>
Task.FromResult(NSWorkspace.SharedWorkspace.OpenUrl(new NSUrl(uri.AbsoluteUri)));
Task.FromResult(NSWorkspace.SharedWorkspace.OpenUrl(GetNativeUrl(uri)));
static Task<bool> PlatformTryOpenAsync(Uri uri)
{
var nativeUrl = GetNativeUrl(uri);
var canOpen = NSWorkspace.SharedWorkspace.UrlForApplication(nativeUrl) != null;
if (canOpen)
{
// TODO: there is an OpenUrlAsync that may be useful
return Task.FromResult(NSWorkspace.SharedWorkspace.OpenUrl(nativeUrl));
}
return Task.FromResult(canOpen);
}
internal static NSUrl GetNativeUrl(Uri uri)
{
try
{
return new NSUrl(uri.OriginalString);
}
catch (Exception ex)
{
Debug.WriteLine("Unable to create Url from Original string, try absolute Uri: " + ex.Message);
return new NSUrl(uri.AbsoluteUri);
}
}
static Task PlatformOpenAsync(OpenFileRequest request) =>
Task.FromResult(NSWorkspace.SharedWorkspace.OpenFile(request.File.FullPath));
}
}

Просмотреть файл

@ -1,9 +0,0 @@
using System;
namespace Xamarin.Essentials
{
public static partial class MainThread
{
// macOS code is exactly the same as iOS, so we use that file directly.
}
}

Просмотреть файл

@ -21,17 +21,6 @@ namespace Xamarin.Essentials
internal static async Task PlatformOpenMapsAsync(Placemark placemark, MapLaunchOptions options)
{
#if __IOS__
var address = new MKPlacemarkAddress
{
CountryCode = placemark.CountryCode,
Country = placemark.CountryName,
State = placemark.AdminArea,
Street = placemark.Thoroughfare,
City = placemark.Locality,
Zip = placemark.PostalCode
}.Dictionary;
#else
var address = new NSDictionary
{
[Contacts.CNPostalAddressKey.City] = new NSString(placemark.Locality),
@ -41,7 +30,6 @@ namespace Xamarin.Essentials
[Contacts.CNPostalAddressKey.PostalCode] = new NSString(placemark.PostalCode),
[Contacts.CNPostalAddressKey.IsoCountryCode] = new NSString(placemark.CountryCode)
};
#endif
var coder = new CLGeocoder();
CLPlacemark[] placemarks = null;

Просмотреть файл

@ -1,57 +0,0 @@
using System.Threading.Tasks;
using Contacts;
using Foundation;
namespace Xamarin.Essentials
{
public static partial class Map
{
// macOS code is exactly the same as iOS, so we use that file directly.
// There is one small difference, iOS uses a MKPlacemarkAddress object
// to AddressBook in order to create a strongly typed object. On macOS,
// and on iOS 10.0+, the Contacts is used instead.
class MKPlacemarkAddress : DictionaryContainer
{
public string City
{
get => GetStringValue(CNPostalAddressKey.City);
set => SetStringValue(CNPostalAddressKey.City, value);
}
public string Country
{
get => GetStringValue(CNPostalAddressKey.Country);
set => SetStringValue(CNPostalAddressKey.Country, value);
}
public string CountryCode
{
get => GetStringValue(CNPostalAddressKey.IsoCountryCode);
set => SetStringValue(CNPostalAddressKey.IsoCountryCode, value);
}
public string State
{
get => GetStringValue(CNPostalAddressKey.State);
set => SetStringValue(CNPostalAddressKey.State, value);
}
public string Street
{
get => GetStringValue(CNPostalAddressKey.Street);
set => SetStringValue(CNPostalAddressKey.Street, value);
}
public string Zip
{
get => GetStringValue(CNPostalAddressKey.PostalCode);
set => SetStringValue(CNPostalAddressKey.PostalCode, value);
}
public static implicit operator NSDictionary(MKPlacemarkAddress address) =>
address.Dictionary;
}
}
}

Просмотреть файл

@ -1,14 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class OrientationSensor
{
internal static bool IsSupported =>
throw new System.PlatformNotSupportedException();
static void PlatformStart(SensorSpeed sensorSpeed) =>
throw new System.PlatformNotSupportedException();
static void PlatformStop() =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,4 +1,5 @@
using System;
/*
using System;
using System.Threading.Tasks;
using CoreLocation;
using Foundation;
@ -105,3 +106,4 @@ namespace Xamarin.Essentials
}
}
}
*/

Просмотреть файл

@ -1,11 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class PhoneDialer
{
internal static bool IsSupported =>
throw new System.PlatformNotSupportedException();
static void PlatformOpen(string number) =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,7 +0,0 @@
namespace Xamarin.Essentials
{
public static partial class Preferences
{
// macOS code is exactly the same as iOS, so we use that file directly.
}
}

Просмотреть файл

@ -1,7 +0,0 @@
namespace Xamarin.Essentials
{
public partial class SecureStorage
{
// macOS code is exactly the same as iOS, so we use that file directly.
}
}

Просмотреть файл

@ -1,13 +0,0 @@
using System.Threading.Tasks;
namespace Xamarin.Essentials
{
public static partial class Share
{
static Task PlatformRequestAsync(ShareTextRequest request) =>
throw new System.PlatformNotSupportedException();
static Task PlatformRequestAsync(ShareFileRequest request) =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,13 +0,0 @@
using System.Threading.Tasks;
namespace Xamarin.Essentials
{
public static partial class Sms
{
internal static bool IsComposeSupported
=> throw new System.PlatformNotSupportedException();
static Task PlatformComposeAsync(SmsMessage message)
=> throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -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, SpeechOptions options, CancellationToken cancelToken = default) =>
throw new System.PlatformNotSupportedException();
internal static Task<IEnumerable<Locale>> PlatformGetLocalesAsync() =>
throw new System.PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,29 +0,0 @@
using System;
using System.Drawing;
using iOSPoint = CoreGraphics.CGPoint;
namespace Xamarin.Essentials
{
public static class PointExtensions
{
public static Point ToSystemPoint(this iOSPoint point)
{
if (point.X > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(point.X));
if (point.Y > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(point.Y));
return new Point((int)point.X, (int)point.Y);
}
public static PointF ToSystemPointF(this iOSPoint point) =>
new PointF((float)point.X, (float)point.Y);
public static iOSPoint ToPlatformPoint(this Point point) =>
new iOSPoint((nfloat)point.X, (nfloat)point.Y);
public static iOSPoint ToPlatformPoint(this PointF point) =>
new iOSPoint((nfloat)point.X, (nfloat)point.Y);
}
}

Просмотреть файл

@ -1,35 +0,0 @@
using System;
using System.Drawing;
using iOSRectangle = CoreGraphics.CGRect;
namespace Xamarin.Essentials
{
public static class RectangleExtensions
{
public static Rectangle ToSystemRectangle(this iOSRectangle rect)
{
if (rect.X > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(rect.X));
if (rect.Y > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(rect.Y));
if (rect.Width > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(rect.Width));
if (rect.Height > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(rect.Height));
return new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Width, (int)rect.Height);
}
public static RectangleF ToSystemRectangleF(this iOSRectangle rect) =>
new RectangleF((float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height);
public static iOSRectangle ToPlatformRectangle(this Rectangle rect) =>
new iOSRectangle((nfloat)rect.X, (nfloat)rect.Y, (nfloat)rect.Width, (nfloat)rect.Height);
public static iOSRectangle ToPlatformRectangle(this RectangleF rect) =>
new iOSRectangle((nfloat)rect.X, (nfloat)rect.Y, (nfloat)rect.Width, (nfloat)rect.Height);
}
}

Просмотреть файл

@ -1,29 +0,0 @@
using System;
using System.Drawing;
using iOSSize = CoreGraphics.CGSize;
namespace Xamarin.Essentials
{
public static class SizeExtensions
{
public static Size ToSystemSize(this iOSSize size)
{
if (size.Width > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(size.Width));
if (size.Height > int.MaxValue)
throw new ArgumentOutOfRangeException(nameof(size.Height));
return new Size((int)size.Width, (int)size.Height);
}
public static SizeF ToSystemSizeF(this iOSSize size) =>
new SizeF((float)size.Width, (float)size.Height);
public static iOSSize ToPlatformSize(this Size size) =>
new iOSSize((nfloat)size.Width, (nfloat)size.Height);
public static iOSSize ToPlatformSize(this SizeF size) =>
new iOSSize((nfloat)size.Width, (nfloat)size.Height);
}
}

Просмотреть файл

@ -1,16 +0,0 @@
using System;
namespace Xamarin.Essentials
{
public static partial class Vibration
{
internal static bool IsSupported =>
throw new PlatformNotSupportedException();
static void PlatformVibrate(TimeSpan duration) =>
throw new PlatformNotSupportedException();
static void PlatformCancel() =>
throw new PlatformNotSupportedException();
}
}

Просмотреть файл

@ -1,7 +1,8 @@
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<PropertyGroup>
<TargetFrameworks>netstandard1.0;netstandard2.0;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.WatchOS10;MonoAndroid80;MonoAndroid81;MonoAndroid90;MonoAndroid10.0;tizen40;Xamarin.Mac20;</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.16299;</TargetFrameworks>
<TargetFrameworks>netstandard2.0;Xamarin.iOS10;Xamarin.Mac20;</TargetFrameworks>
<!-- <TargetFrameworks>netstandard1.0;netstandard2.0;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.WatchOS10;MonoAndroid80;MonoAndroid81;MonoAndroid90;MonoAndroid10.0;tizen40;Xamarin.Mac20;</TargetFrameworks> -->
<!-- <TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.16299;</TargetFrameworks> -->
<AssemblyName>Xamarin.Essentials</AssemblyName>
<RootNamespace>Xamarin.Essentials</RootNamespace>
<PackageId>Xamarin.Essentials</PackageId>
@ -110,10 +111,16 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('tizen')) ">
<PackageReference Include="Tizen.NET" Version="4.0.0" />
<PackageReference Include="Tizen.NET" Version="4.0.0" PrivateAssets="All" />
<Compile Include="**\*.tizen.cs" />
<Compile Include="**\*.tizen.*.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.Mac20')) ">
<Compile Include="**\*.mac.cs" />
<Compile Include="**\*.mac.*.cs" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<None Remove="mdoc.targets" />
</ItemGroup>