summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs')
-rw-r--r--src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs b/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs
index efd949f565..76bf0008f9 100644
--- a/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs
+++ b/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs
@@ -23,6 +23,7 @@ namespace System.Resources {
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
+ using System.Diagnostics;
using System.Diagnostics.Contracts;
internal class FileBasedResourceGroveler : IResourceGroveler
@@ -31,17 +32,16 @@ namespace System.Resources {
public FileBasedResourceGroveler(ResourceManager.ResourceManagerMediator mediator)
{
- Contract.Assert(mediator != null, "mediator shouldn't be null; check caller");
+ Debug.Assert(mediator != null, "mediator shouldn't be null; check caller");
_mediator = mediator;
}
// Consider modifying IResourceGroveler interface (hence this method signature) when we figure out
// serialization compat story for moving ResourceManager members to either file-based or
// manifest-based classes. Want to continue tightening the design to get rid of unused params.
- [System.Security.SecuritySafeCritical] // auto-generated
public ResourceSet GrovelForResourceSet(CultureInfo culture, Dictionary<String, ResourceSet> localResourceSets, bool tryParents, bool createIfNotExists, ref StackCrawlMark stackMark)
{
- Contract.Assert(culture != null, "culture shouldn't be null; check caller");
+ Debug.Assert(culture != null, "culture shouldn't be null; check caller");
String fileName = null;
ResourceSet rs = null;
@@ -79,24 +79,6 @@ namespace System.Resources {
}
}
-#if !FEATURE_CORECLR // PAL doesn't support eventing, and we don't compile event providers for coreclr
- public bool HasNeutralResources(CultureInfo culture, String defaultResName)
- {
- // Detect missing neutral locale resources.
- String defaultResPath = FindResourceFile(culture, defaultResName);
- if (defaultResPath == null || !File.Exists(defaultResPath))
- {
- String dir = _mediator.ModuleDir;
- if (defaultResPath != null)
- {
- dir = Path.GetDirectoryName(defaultResPath);
- }
- return false;
- }
- return true;
- }
-#endif
-
// Given a CultureInfo, it generates the path &; file name for
// the .resources file for that CultureInfo. This method will grovel
// the disk looking for the correct file name & path. Uses CultureInfo's
@@ -107,8 +89,8 @@ namespace System.Resources {
private String FindResourceFile(CultureInfo culture, String fileName)
{
- Contract.Assert(culture != null, "culture shouldn't be null; check caller");
- Contract.Assert(fileName != null, "fileName shouldn't be null; check caller");
+ Debug.Assert(culture != null, "culture shouldn't be null; check caller");
+ Debug.Assert(fileName != null, "fileName shouldn't be null; check caller");
// If we have a moduleDir, check there first. Get module fully
// qualified name, append path to that.
@@ -145,10 +127,9 @@ namespace System.Resources {
// Constructs a new ResourceSet for a given file name. The logic in
// here avoids a ReflectionPermission check for our RuntimeResourceSet
// for perf and working set reasons.
- [System.Security.SecurityCritical]
private ResourceSet CreateResourceSet(String file)
{
- Contract.Assert(file != null, "file shouldn't be null; check caller");
+ Debug.Assert(file != null, "file shouldn't be null; check caller");
if (_mediator.UserResourceSet == null)
{