Obsolete in some places
This commit is contained in:
Родитель
89fa9a3412
Коммит
de7308e6a5
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using CoreFoundation;
|
||||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
|
@ -28,7 +27,9 @@ namespace Xamarin.Essentials
|
|||
|
||||
try
|
||||
{
|
||||
return CFString.FromHandle(computerNameHandle);
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
return NSString.FromHandle(computerNameHandle);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -232,7 +232,9 @@ namespace Xamarin.Essentials
|
|||
|
||||
// we weren't able to work out what was happening, so try and guess
|
||||
var typeHandle = IOPSGetProvidingPowerSourceType(infoHandle);
|
||||
if (CFString.FromHandle(typeHandle) == kIOPMBatteryPowerKey)
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
if (NSString.FromHandle(typeHandle) == kIOPMBatteryPowerKey)
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
return BatteryState.Discharging;
|
||||
|
||||
return BatteryState.NotCharging;
|
||||
|
@ -297,7 +299,7 @@ namespace Xamarin.Essentials
|
|||
{
|
||||
infoHandle = IOPSCopyPowerSourcesInfo();
|
||||
var typeHandle = IOPSGetProvidingPowerSourceType(infoHandle);
|
||||
switch (CFString.FromHandle(typeHandle))
|
||||
switch (NSString.FromHandle(typeHandle))
|
||||
{
|
||||
case kIOPMBatteryPowerKey:
|
||||
return BatteryPowerSource.Battery;
|
||||
|
|
Загрузка…
Ссылка в новой задаче