Skip to content

BamlMapTable's KnownAssemblyInfoRecord should be an instance field #589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2019
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 @@ -79,10 +79,10 @@ internal BamlMapTable(XamlTypeMapper xamlTypeMapper)
_xamlTypeMapper = xamlTypeMapper;

// Setup the assembly record for the known types of controls
KnownAssemblyInfoRecord = new BamlAssemblyInfoRecord();
KnownAssemblyInfoRecord.AssemblyId = -1;
KnownAssemblyInfoRecord.Assembly = ReflectionHelper.LoadAssembly(_frameworkAssembly, string.Empty);
KnownAssemblyInfoRecord.AssemblyFullName = KnownAssemblyInfoRecord.Assembly.FullName;
_knownAssemblyInfoRecord = new BamlAssemblyInfoRecord();
_knownAssemblyInfoRecord.AssemblyId = -1;
_knownAssemblyInfoRecord.Assembly = ReflectionHelper.LoadAssembly(_frameworkAssembly, string.Empty);
_knownAssemblyInfoRecord.AssemblyFullName = _knownAssemblyInfoRecord.Assembly.FullName;
}

#endregion Constructor
Expand Down Expand Up @@ -995,7 +995,7 @@ internal BamlAssemblyInfoRecord GetAssemblyInfoFromId(short id)
// case return the known assembly info record.
if (id == -1)
{
return KnownAssemblyInfoRecord;
return _knownAssemblyInfoRecord;
}
else
{
Expand Down Expand Up @@ -1803,7 +1803,6 @@ private Hashtable ConverterCache

private const string _coreAssembly = "PresentationCore";
private const string _frameworkAssembly = "PresentationFramework";
private static BamlAssemblyInfoRecord KnownAssemblyInfoRecord;

private static string[] _knownStrings =
{
Expand All @@ -1830,6 +1829,9 @@ private Hashtable ConverterCache
// XamlTypeMapper associated with this map table. There is always a one-to-one correspondence.
XamlTypeMapper _xamlTypeMapper;

// The assembly record for the known types of controls
BamlAssemblyInfoRecord _knownAssemblyInfoRecord;

#if !PBTCOMPILER
// Temporary cache of Known Type Converters for each baml reading session.
Hashtable _converterCache = null;
Expand Down