protected override void FreezeInternal()
 {
     base.FreezeInternal();
     assemblyAttributes = FreezableHelper.FreezeListAndElements(assemblyAttributes);
     moduleAttributes   = FreezableHelper.FreezeListAndElements(moduleAttributes);
     foreach (var type in typeDefinitions.Values)
     {
         FreezableHelper.Freeze(type);
     }
 }
Beispiel #2
0
        public override ISupportsInterning Intern(ISupportsInterning obj)
        {
            if (obj == null)
            {
                return(null);
            }

            // ensure objects are frozen when we put them into the dictionary
            // note that Freeze may change the hash code of the object
            FreezableHelper.Freeze(obj);

            ISupportsInterning output;

            if (supportsInternDict.TryGetValue(obj, out output))
            {
                return(output);
            }
            else
            {
                supportsInternDict.Add(obj, obj);
                return(obj);
            }
        }