Files
BrightSharp.Toolkit/BrightSharp.Toolkit.Extra/DesignTimeConfig.cs
2017-02-18 00:15:59 +03:00

32 lines
978 B
C#

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;
}
}
}