PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. namespace Microsoft.VisualStudio.ServiceModel.DomainServices.Tools
  2. {
  3. using Microsoft.Win32;
  4. using System;
  5. using System.Globalization;
  6. using System.Runtime.CompilerServices;
  7. using System.Security;
  8. internal static class TemplateUtilities
  9. {
  10. [DecimalConstant(1, 0, (uint) 0, (uint) 0, (uint) 40)]
  11. internal static readonly decimal DefaultSilverlightVersion = 4.0M;
  12. private const string SilverlightDesignerKeyName = @"Software\Microsoft\VisualStudio\10.0\DesignerPlatforms\Silverlight";
  13. private const string SilverlightHostValueName = "SilverlightHost";
  14. internal static string GetSilverlightToolsVersion()
  15. {
  16. string str = string.Format(CultureInfo.InvariantCulture, "v{0:0.0}", new object[] { 4.0M });
  17. try
  18. {
  19. using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0\DesignerPlatforms\Silverlight"))
  20. {
  21. if (key != null)
  22. {
  23. str = (string) key.GetValue("SilverlightHost");
  24. }
  25. }
  26. }
  27. catch (SecurityException)
  28. {
  29. }
  30. return str;
  31. }
  32. }
  33. }