/SolutionFramework/Microsoft.VisualStudio.ServiceModel.DomainServices.Tools.10.0/Microsoft/VisualStudio/ServiceModel/DomainServices/Tools/TemplateUtilities.cs
C# | 36 lines | 33 code | 3 blank | 0 comment | 2 complexity | 7a8a8547d38264726c78c599b26b0bd9 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-3.0
- namespace Microsoft.VisualStudio.ServiceModel.DomainServices.Tools
- {
- using Microsoft.Win32;
- using System;
- using System.Globalization;
- using System.Runtime.CompilerServices;
- using System.Security;
-
- internal static class TemplateUtilities
- {
- [DecimalConstant(1, 0, (uint) 0, (uint) 0, (uint) 40)]
- internal static readonly decimal DefaultSilverlightVersion = 4.0M;
- private const string SilverlightDesignerKeyName = @"Software\Microsoft\VisualStudio\10.0\DesignerPlatforms\Silverlight";
- private const string SilverlightHostValueName = "SilverlightHost";
-
- internal static string GetSilverlightToolsVersion()
- {
- string str = string.Format(CultureInfo.InvariantCulture, "v{0:0.0}", new object[] { 4.0M });
- try
- {
- using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0\DesignerPlatforms\Silverlight"))
- {
- if (key != null)
- {
- str = (string) key.GetValue("SilverlightHost");
- }
- }
- }
- catch (SecurityException)
- {
- }
- return str;
- }
- }
- }
-