Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected ResourceSet()
{
// To not inconvenience people subclassing us, we should allocate a new
// hashtable here just so that Table is set to something.
CommonInit();
Table = new Hashtable();
}

// For RuntimeResourceSet, ignore the Table parameter - it's a wasted
Expand All @@ -50,9 +50,9 @@ internal ResourceSet(bool junk)
// on disk.
//
public ResourceSet(string fileName)
: this()
{
Reader = new ResourceReader(fileName);
CommonInit();
ReadResources();
}

Expand All @@ -61,26 +61,21 @@ public ResourceSet(string fileName)
// of data.
//
public ResourceSet(Stream stream)
: this()
{
Reader = new ResourceReader(stream);
CommonInit();
ReadResources();
}

public ResourceSet(IResourceReader reader)
: this()
{
if (reader == null)
throw new ArgumentNullException(nameof(reader));
Reader = reader;
CommonInit();
ReadResources();
}

private void CommonInit()
{
Table = new Hashtable();
}

// Closes and releases any resources used by this ResourceSet, if any.
// All calls to methods on the ResourceSet after a call to close may
// fail. Close is guaranteed to be safely callable multiple times on a
Expand Down