mirror of
https://github.com/ckaczor/Common.git
synced 2026-01-13 17:22:40 -05:00
Start of improved browser support
This commit is contained in:
@@ -10,10 +10,14 @@
|
|||||||
<RootNamespace>Common</RootNamespace>
|
<RootNamespace>Common</RootNamespace>
|
||||||
<AssemblyName>Common</AssemblyName>
|
<AssemblyName>Common</AssemblyName>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<SccProjectName>SAK</SccProjectName>
|
<SccProjectName>
|
||||||
<SccLocalPath>SAK</SccLocalPath>
|
</SccProjectName>
|
||||||
<SccAuxPath>SAK</SccAuxPath>
|
<SccLocalPath>
|
||||||
<SccProvider>SAK</SccProvider>
|
</SccLocalPath>
|
||||||
|
<SccAuxPath>
|
||||||
|
</SccAuxPath>
|
||||||
|
<SccProvider>
|
||||||
|
</SccProvider>
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<UpgradeBackupLocation>
|
<UpgradeBackupLocation>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace Common.Internet
|
|||||||
public string Command { get; private set; }
|
public string Command { get; private set; }
|
||||||
public string DefaultIcon { get; private set; }
|
public string DefaultIcon { get; private set; }
|
||||||
public ImageSource DefaultImage { get; private set; }
|
public ImageSource DefaultImage { get; private set; }
|
||||||
|
public bool SupportsPrivate { get; private set; }
|
||||||
|
|
||||||
public void LoadImage()
|
public void LoadImage()
|
||||||
{
|
{
|
||||||
@@ -41,11 +42,6 @@ namespace Common.Internet
|
|||||||
DefaultImage = wpfBitmap;
|
DefaultImage = wpfBitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SupportsPrivate()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Name;
|
return Name;
|
||||||
@@ -69,15 +65,22 @@ namespace Common.Internet
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<string, Browser> DetectInstalledBrowsers()
|
public static Dictionary<string, Browser> DetectInstalledBrowsers(bool loadImages, bool includeUseSystemDefault)
|
||||||
{
|
|
||||||
return DetectInstalledBrowsers(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Dictionary<string, Browser> DetectInstalledBrowsers(bool loadImages)
|
|
||||||
{
|
{
|
||||||
var browsers = new Dictionary<string, Browser>();
|
var browsers = new Dictionary<string, Browser>();
|
||||||
|
|
||||||
|
if (includeUseSystemDefault)
|
||||||
|
{
|
||||||
|
var browser = new Browser
|
||||||
|
{
|
||||||
|
Key = string.Empty,
|
||||||
|
Name = "System Default",
|
||||||
|
SupportsPrivate = false
|
||||||
|
};
|
||||||
|
|
||||||
|
browsers.Add(browser.Key, browser);
|
||||||
|
}
|
||||||
|
|
||||||
var browserKeys = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Clients\StartMenuInternet");
|
var browserKeys = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Clients\StartMenuInternet");
|
||||||
|
|
||||||
if (browserKeys == null)
|
if (browserKeys == null)
|
||||||
@@ -107,7 +110,8 @@ namespace Common.Internet
|
|||||||
Key = browserName,
|
Key = browserName,
|
||||||
Name = (string) browserKey.GetValue(null),
|
Name = (string) browserKey.GetValue(null),
|
||||||
Command = (string) browserKeyPath.GetValue(null),
|
Command = (string) browserKeyPath.GetValue(null),
|
||||||
DefaultIcon = browserIconPath == null ? null : (string) browserIconPath.GetValue(null)
|
DefaultIcon = browserIconPath == null ? null : (string) browserIconPath.GetValue(null),
|
||||||
|
SupportsPrivate = true
|
||||||
};
|
};
|
||||||
|
|
||||||
if (loadImages)
|
if (loadImages)
|
||||||
|
|||||||
Reference in New Issue
Block a user