Class NullDeviceUiProvider
- Namespace
- VpnHood.AppLib.Abstractions.Device
- Assembly
- VpnHood.AppLib.Abstractions.dll
Provides a device UI provider that supports none of the features, as the base of a platform's own: each flag is false and each request throws NotSupportedException, but a web browser is taken as present.
public class NullDeviceUiProvider : IDeviceUiProvider
- Inheritance
-
NullDeviceUiProvider
- Implements
- Inherited Members
Properties
IsAlwaysOnSettingsSupported
Gets a value indicating whether the app can open the system's always-on VPN setting.
public virtual bool IsAlwaysOnSettingsSupported { get; }
Property Value
IsAppNotificationSettingsSupported
Gets a value indicating whether the app can open its notification settings in the system's settings.
public virtual bool IsAppNotificationSettingsSupported { get; }
Property Value
IsAppSettingsSupported
Gets a value indicating whether the app can open its own page in the system's settings.
public virtual bool IsAppSettingsSupported { get; }
Property Value
IsKillSwitchSettingsSupported
Gets a value indicating whether the app can open the system's kill switch setting, which blocks the connections made without the VPN.
public virtual bool IsKillSwitchSettingsSupported { get; }
Property Value
IsNotificationEnabled
Gets a value indicating whether the app may show notifications, or null where the device does not say.
public virtual bool? IsNotificationEnabled { get; }
Property Value
- bool?
Remarks
It is false.
IsPrivateDnsSettingsSupported
Gets a value indicating whether the device has a private DNS setting, which can take the DNS past the VPN.
public virtual bool IsPrivateDnsSettingsSupported { get; }
Property Value
IsProxySettingsSupported
Gets a value indicating whether the device can tell its proxy settings.
public virtual bool IsProxySettingsSupported { get; }
Property Value
IsQuickLaunchSupported
Gets a value indicating whether the device offers the app's Quick Launch: a shortcut in the system's own UI, as Android's Quick Settings tile, that connects the VPN.
public virtual bool IsQuickLaunchSupported { get; }
Property Value
IsRequestNotificationSupported
Gets a value indicating whether the app can ask the person to let it show notifications.
public virtual bool IsRequestNotificationSupported { get; }
Property Value
IsRequestQuickLaunchSupported
Gets a value indicating whether the app can ask the system to add its Quick Launch for the person.
public virtual bool IsRequestQuickLaunchSupported { get; }
Property Value
IsSettingsSupported
Gets a value indicating whether the app can open the system's settings.
public virtual bool IsSettingsSupported { get; }
Property Value
IsShareSupported
Whether the device has a share sheet, which hands a file to an app the user picks. False on a TV and a computer, where the UI copies the text instead.
public virtual bool IsShareSupported { get; }
Property Value
IsWebBrowserSupported
Whether a page can be handed to an EXTERNAL browser. Not "can this app draw a page" — the UI can always render a page inside itself; this is only about leaving the app. False on a device with no browser, which is where an outbound link opens nothing at all: the UI withholds the link rather than offering a dead one.
public virtual bool IsWebBrowserSupported { get; }
Property Value
Remarks
It is true: every desktop and phone platform has a browser, and a platform that does not is the one that must say so.
Methods
GetBarsInfo(IUiContext)
Gets the heights of the system bars over the app's window, for its layout to leave room.
public virtual SystemBarsInfo GetBarsInfo(IUiContext uiContext)
Parameters
uiContextIUiContextThe app's UI context.
Returns
- SystemBarsInfo
The bars' heights; none where the device cannot tell them.
Remarks
It gives no height.
GetPrivateDns()
Gets the device's private DNS, which can take the DNS past the VPN.
public virtual PrivateDns? GetPrivateDns()
Returns
- PrivateDns
The private DNS, or null where the device cannot tell it.
Remarks
It gives null.
GetProxySettings()
Gets the device's proxy settings.
public virtual DeviceProxySettings? GetProxySettings()
Returns
- DeviceProxySettings
The settings, or null where the device has no proxy or cannot tell it.
Remarks
It gives null.
KeepScreenOn(IUiContext, bool)
Holds off the screen's idle sleep while the app is in front, for a page that is meant to stay up with nobody at the remote. An implementation that does not support it, as the Windows one, does nothing.
public virtual Task KeepScreenOn(IUiContext uiContext, bool value)
Parameters
uiContextIUiContextThe app's UI context.
valuebool
Returns
- Task
A task that completes once it is set.
Remarks
It does nothing.
OpenAlwaysOnSettings(IUiContext)
Opens the system's VPN settings, where the person turns always-on VPN on for the app.
public virtual void OpenAlwaysOnSettings(IUiContext uiContext)
Parameters
uiContextIUiContextThe app's UI context.
Exceptions
- NotSupportedException
The device cannot open them.
- NotSupportedException
Always.
OpenAppNotificationSettings(IUiContext)
Opens the app's notification settings in the system's settings.
public virtual void OpenAppNotificationSettings(IUiContext uiContext)
Parameters
uiContextIUiContextThe app's UI context.
Exceptions
- NotSupportedException
The device cannot open them.
- NotSupportedException
Always.
OpenAppSettings(IUiContext)
Opens the app's own page in the system's settings.
public virtual void OpenAppSettings(IUiContext context)
Parameters
contextIUiContextThe app's UI context.
Exceptions
- NotSupportedException
The device cannot open it.
- NotSupportedException
Always.
OpenKillSwitchSettings(IUiContext)
Opens the system's VPN settings, where the person turns the system's kill switch on for the app.
public virtual void OpenKillSwitchSettings(IUiContext requiredContext)
Parameters
requiredContextIUiContextThe app's UI context.
Exceptions
- NotSupportedException
The device cannot open them.
- NotSupportedException
Always.
OpenSettings(IUiContext)
Opens the system's settings.
public virtual void OpenSettings(IUiContext uiContext)
Parameters
uiContextIUiContextThe app's UI context.
Exceptions
- NotSupportedException
The device cannot open them.
- NotSupportedException
Always.
RequestNotification(IUiContext, CancellationToken)
Asks the person to let the app show notifications.
public virtual Task<bool> RequestNotification(IUiContext uiContext, CancellationToken cancellationToken)
Parameters
uiContextIUiContextThe app's UI context.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- NotSupportedException
The device cannot ask for it.
- OperationCanceledException
cancellationTokenwas canceled.- NotSupportedException
Always.
RequestQuickLaunch(IUiContext, CancellationToken)
Asks the system to add the app's Quick Launch, which the person accepts or refuses.
public virtual Task<bool> RequestQuickLaunch(IUiContext uiContext, CancellationToken cancellationToken)
Parameters
uiContextIUiContextThe app's UI context.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Remarks
Android's throws its RequestQuickLaunchException where the system answers no within a second of the
request.
Exceptions
- NotSupportedException
The device cannot ask for it.
- OperationCanceledException
cancellationTokenwas canceled.- NotSupportedException
Always.
ShareFile(IUiContext, string, byte[])
Hands a file to an app the person picks in the device's share sheet.
public virtual void ShareFile(IUiContext uiContext, string fileName, byte[] content)
Parameters
uiContextIUiContextThe app's UI context.
fileNamestringThe file's name.
contentbyte[]The file's content.
Exceptions
- NotSupportedException
The device has no share sheet.
- InvalidOperationException
There is no window to share from, as iOS's finds none.
- NotSupportedException
Always.