diff options
author | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2015-02-03 05:29:33 +0300 |
---|---|---|
committer | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2015-02-03 23:29:46 +0300 |
commit | 946ae56dd9261798f743807f4a7a99de6340f914 (patch) | |
tree | 10b1e46b7b639a6b68455bb444f348cc383b3021 /main/src | |
parent | 2dcaca0bfeb0f09c84629cee9c13445bfc0a58ca (diff) |
[Ide] Fix resource namespace in resx generators
The resource namspace is the project's default namespace,
not the tool namespace.
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs index a993f0648d..d046af684c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs @@ -67,26 +67,26 @@ namespace MonoDevelop.Ide.CustomTools var provider = dnp.LanguageBinding.GetCodeDomProvider (); if (provider == null) { - var err = "ResXFileCodeGenerator can only be used with languages that support CodeDOM"; + const string err = "ResXFileCodeGenerator can only be used with languages that support CodeDOM"; result.Errors.Add (new CompilerError (null, 0, 0, null, err)); return; } var outputfile = file.FilePath.ChangeExtension (".Designer." + provider.FileExtension); - var ns = CustomToolService.GetFileNamespace (file, outputfile); - var cn = provider.CreateValidIdentifier (file.FilePath.FileNameWithoutExtension); - var rd = new Dictionary<object, object> (); + var codeNamespace = CustomToolService.GetFileNamespace (file, outputfile); + var name = provider.CreateValidIdentifier (file.FilePath.FileNameWithoutExtension); + var resourcesNamespace = dnp.DefaultNamespace; + var rd = new Dictionary<object, object> (); using (var r = new ResXResourceReader (file.FilePath)) { r.BasePath = file.FilePath.ParentDirectory; - foreach (DictionaryEntry e in r) { rd.Add (e.Key, e.Value); } } string[] unmatchable; - var ccu = StronglyTypedResourceBuilder.Create (rd, cn, ns, provider, internalClass, out unmatchable); + var ccu = StronglyTypedResourceBuilder.Create (rd, name, codeNamespace, resourcesNamespace, provider, internalClass, out unmatchable); if (TargetsPcl2Framework (dnp)) { FixupPclTypeInfo (ccu); |