mirror of
https://github.com/bitwarden/mobile
synced 2025-12-23 03:33:59 +00:00
resolving warnings for obsolete APIs
This commit is contained in:
26
src/App/Utilities/Helpers.cs
Normal file
26
src/App/Utilities/Helpers.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Utilities
|
||||
{
|
||||
public static class Helpers
|
||||
{
|
||||
public static T OnPlatform<T>(T iOS = default(T), T Android = default(T),
|
||||
T WinPhone = default(T), T Windows = default(T))
|
||||
{
|
||||
switch(Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
return iOS;
|
||||
case Device.Android:
|
||||
return Android;
|
||||
case Device.WinPhone:
|
||||
return WinPhone;
|
||||
case Device.Windows:
|
||||
return Windows;
|
||||
default:
|
||||
throw new Exception("Unsupported platform.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user