Skip to content

Instantly share code, notes, and snippets.

@mkrueger
Created June 18, 2012 12:37
Show Gist options
  • Save mkrueger/2948184 to your computer and use it in GitHub Desktop.
Save mkrueger/2948184 to your computer and use it in GitHub Desktop.
public IList<ITypeDefinition> NestedTypes {
get {
IList<ITypeDefinition> result = LazyInit.VolatileRead(ref this.nestedTypes);
if (result != null) {
return result;
} else {
result = (
from part in parts
from nestedTypeRef in part.NestedTypes
group nestedTypeRef by nestedTypeRef.Name into g
select new DefaultResolvedTypeDefinition(new SimpleTypeResolveContext(this), g.ToArray())
).ToList<ITypeDefinition>().AsReadOnly();
return LazyInit.GetOrSet(ref this.nestedTypes, result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment