mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 10:21:16 +00:00
Ok, Just Do It!
This commit is contained in:
31
BrightSharp.Toolkit.Extra/DesignTimeConfig.cs
Normal file
31
BrightSharp.Toolkit.Extra/DesignTimeConfig.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.IO;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace BrightSharp.Toolkit.Extra
|
||||
{
|
||||
public static class DesignTimeConfig
|
||||
{
|
||||
public static void SetNugetPackagesDirectory(string nugetDir)
|
||||
{
|
||||
if (Directory.Exists(nugetDir))
|
||||
{
|
||||
Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Brightsharp").SetValue("NUGET_PACKAGES", nugetDir);
|
||||
}
|
||||
}
|
||||
public static void DesignTimeUnRegisterNugetPackages()
|
||||
{
|
||||
Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Brightsharp").SetValue("NUGET_PACKAGES", null);
|
||||
}
|
||||
|
||||
internal static string GetNugetPackagesDirectory()
|
||||
{
|
||||
var regKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Brightsharp");
|
||||
if (regKey != null)
|
||||
{
|
||||
var regValue = regKey.GetValue("NUGET_PACKAGES");
|
||||
return (regValue ?? string.Empty).ToString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user