From e32d1b069f9df038ea824aabcaaa57b43cd20e7d Mon Sep 17 00:00:00 2001 From: AndriySvyryd Date: Fri, 27 Jun 2014 15:27:26 -0700 Subject: [PATCH] Using the default namespace for the resources class --- build/Resources.tt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build/Resources.tt b/build/Resources.tt index c22ec1f955..f6b0355d1d 100644 --- a/build/Resources.tt +++ b/build/Resources.tt @@ -21,6 +21,7 @@ var templateProjectItem = dte.Solution.FindProjectItem(Host.TemplateFile); var projectDirectory = Path.GetDirectoryName(templateProjectItem.ContainingProject.FullName); var ttDirectory = Path.Combine(projectDirectory, "Properties"); + var projectNamespace = templateProjectItem.ContainingProject.Properties.Item("DefaultNamespace").Value; var projectName = Path.GetFileName(projectDirectory.TrimEnd('/')); var namedParameterMatcher = new Regex(@"\{([a-z]\w+)\}", RegexOptions.IgnoreCase); var numberParameterMatcher = new Regex(@"\{(\d+)\}"); @@ -74,11 +75,11 @@ namespace {0} using System.Reflection; using System.Resources; - internal static class {1} + internal static class {2} {{ private static readonly ResourceManager _resourceManager - = new ResourceManager(""{0}.{1}"", typeof({1}).GetTypeInfo().Assembly); -", projectName, fileName); + = new ResourceManager(""{1}.{2}"", typeof({2}).GetTypeInfo().Assembly); +", projectNamespace, projectName, fileName); foreach (var resourceString in resourceStrings) { @@ -97,7 +98,7 @@ namespace {0} var value = _resourceManager.GetString(name); System.Diagnostics.Debug.Assert(value != null); - + if (formatterNames != null) { for (var i = 0; i < formatterNames.Length; i++)