initialize refsByID if it has not been initialized yet

This commit is contained in:
Michael Becker 2020-09-16 14:22:42 -04:00
parent c1aafc0052
commit b77ba0339b
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -95,6 +95,16 @@ namespace UniversalEditor
/// <returns>True if an <see cref="ObjectModelReference" /> with the specified ID exists in the collection; false otherwise.</returns>
public bool Contains(Guid ID)
{
if (refsByID.Count == 0)
{
foreach (ObjectModelReference omr in this)
{
if (omr.ID != Guid.Empty)
{
refsByID.Add(omr.ID, omr);
}
}
}
return (refsByID.ContainsKey(ID));
}
/// <summary>