public NS(NS parentNamespace, string fullName, string name)
 {
     this.assembly        = parentNamespace.assembly;
     this.parentNamespace = parentNamespace;
     this.fullName        = fullName;
     this.name            = name;
     if (parentNamespace.types != null)
     {
         this.types = new Dictionary <TopLevelTypeName, ITypeDefinition>(parentNamespace.types.Comparer);
     }
 }
 public NS(CSharpAssembly assembly)
 {
     this.assembly = assembly;
     this.fullName = string.Empty;
     this.name     = string.Empty;
     // Our main dictionary for the CSharpAssembly is using an ordinal comparer.
     // If the compilation's comparer isn't ordinal, we need to create a new dictionary with the compilation's comparer.
     if (assembly.compilation.NameComparer != StringComparer.Ordinal)
     {
         this.types = new Dictionary <TopLevelTypeName, ITypeDefinition>(new TopLevelTypeNameComparer(assembly.compilation.NameComparer));
     }
 }
			public NS(NS parentNamespace, string fullName, string name)
			{
				this.assembly = parentNamespace.assembly;
				this.parentNamespace = parentNamespace;
				this.fullName = fullName;
				this.name = name;
				if (parentNamespace.types != null)
					this.types = new Dictionary<TopLevelTypeName, ITypeDefinition>(parentNamespace.types.Comparer);
			}
			public NS(CSharpAssembly assembly)
			{
				this.assembly = assembly;
				this.fullName = string.Empty;
				this.name = string.Empty;
				// Our main dictionary for the CSharpAssembly is using an ordinal comparer.
				// If the compilation's comparer isn't ordinal, we need to create a new dictionary with the compilation's comparer.
				if (assembly.compilation.NameComparer != StringComparer.Ordinal) {
					this.types = new Dictionary<TopLevelTypeName, ITypeDefinition>(new TopLevelTypeNameComparer(assembly.compilation.NameComparer));
				}
			}
		IAssembly IAssemblyReference.Resolve(ITypeResolveContext context)
		{
			if (context == null)
				throw new ArgumentNullException("context");
			var cache = context.Compilation.CacheManager;
			IAssembly asm = (IAssembly)cache.GetShared(this);
			if (asm != null) {
				return asm;
			} else {
				asm = new CSharpAssembly(context.Compilation, this);
				return (IAssembly)cache.GetOrAddShared(this, asm);
			}
		}