- mobile UI adapted
This commit is contained in:
parent
75e0737acd
commit
8908efc93e
2 changed files with 18 additions and 3 deletions
|
@ -289,12 +289,12 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
|
||||||
InitializeFileSystem();
|
InitializeFileSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
private DriveInfo[] GetDrives(bool showAll = false)
|
private DriveInfo[] GetDrives()
|
||||||
{
|
{
|
||||||
var drives = DriveInfo.GetDrives();
|
var drives = DriveInfo.GetDrives();
|
||||||
int noDrives = (int)Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", "NoDrives", 0);
|
int noDrives = (int)Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", "NoDrives", 0);
|
||||||
|
|
||||||
if (noDrives > 0 && !showAll)
|
if (noDrives > 0)
|
||||||
{
|
{
|
||||||
return drives.Where(drive => (noDrives & (int)(Math.Pow(2, (int)(drive.RootDirectory.ToString()[0]) - 65))) == 0).ToArray();
|
return drives.Where(drive => (noDrives & (int)(Math.Pow(2, (int)(drive.RootDirectory.ToString()[0]) - 65))) == 0).ToArray();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using FontAwesome.WPF;
|
using FontAwesome.WPF;
|
||||||
|
using Microsoft.Win32;
|
||||||
using SafeExamBrowser.I18n.Contracts;
|
using SafeExamBrowser.I18n.Contracts;
|
||||||
using SafeExamBrowser.UserInterface.Contracts.FileSystemDialog;
|
using SafeExamBrowser.UserInterface.Contracts.FileSystemDialog;
|
||||||
using SafeExamBrowser.UserInterface.Contracts.Windows;
|
using SafeExamBrowser.UserInterface.Contracts.Windows;
|
||||||
|
@ -288,6 +289,20 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
|
||||||
InitializeFileSystem();
|
InitializeFileSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DriveInfo[] GetDrives()
|
||||||
|
{
|
||||||
|
var drives = DriveInfo.GetDrives();
|
||||||
|
int noDrives = (int)Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", "NoDrives", 0);
|
||||||
|
|
||||||
|
if (noDrives > 0)
|
||||||
|
{
|
||||||
|
return drives.Where(drive => (noDrives & (int)(Math.Pow(2, (int)(drive.RootDirectory.ToString()[0]) - 65))) == 0).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
return drives;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void InitializeFileSystem()
|
private void InitializeFileSystem()
|
||||||
{
|
{
|
||||||
if (restrictNavigation && !string.IsNullOrEmpty(initialPath))
|
if (restrictNavigation && !string.IsNullOrEmpty(initialPath))
|
||||||
|
@ -318,7 +333,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
|
||||||
|
|
||||||
private void InitializeUnrestricted()
|
private void InitializeUnrestricted()
|
||||||
{
|
{
|
||||||
foreach (var drive in DriveInfo.GetDrives())
|
foreach (var drive in GetDrives())
|
||||||
{
|
{
|
||||||
FileSystem.Items.Add(CreateItem(drive.RootDirectory));
|
FileSystem.Items.Add(CreateItem(drive.RootDirectory));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue