private Dictionary<XmlQualifiedName, object> GetReferencedCollectionTypes()
{
if (_referencedCollectionTypesDictionary == null)
{
_referencedCollectionTypesDictionary = new Dictionary<XmlQualifiedName, object>();
if (_referencedCollectionTypes != null)
{
foreach (Type type in _referencedCollectionTypes)
{
if (type == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.ReferencedCollectionTypesCannotContainNull)));
AddReferencedType(_referencedCollectionTypesDictionary, type);
}
}
XmlQualifiedName genericDictionaryName = DataContract.GetStableName(Globals.TypeOfDictionaryGeneric);
if (!_referencedCollectionTypesDictionary.ContainsKey(genericDictionaryName) && GetReferencedTypes().ContainsKey(genericDictionaryName))
AddReferencedType(_referencedCollectionTypesDictionary, Globals.TypeOfDictionaryGeneric);
}
return _referencedCollectionTypesDictionary;
}