Browse Source

Add INamespace.ContributingAssemblies.

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
a3534f250d
  1. 4
      ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs
  2. 4
      ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs
  3. 5
      ICSharpCode.NRefactory/TypeSystem/INamespace.cs
  4. 4
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs
  5. 5
      ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs

4
ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs

@ -290,6 +290,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem @@ -290,6 +290,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
get { return assembly.Compilation; }
}
IEnumerable<IAssembly> INamespace.ContributingAssemblies {
get { return new [] { assembly }; }
}
INamespace INamespace.GetChildNamespace(string name)
{
var nameComparer = assembly.compilation.NameComparer;

4
ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs

@ -172,6 +172,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem @@ -172,6 +172,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
get { return EmptyList<ITypeDefinition>.Instance; }
}
IEnumerable<IAssembly> INamespace.ContributingAssemblies {
get { return EmptyList<IAssembly>.Instance; }
}
ICompilation IResolved.Compilation {
get { return parentNamespace.Compilation; }
}

5
ICSharpCode.NRefactory/TypeSystem/INamespace.cs

@ -62,6 +62,11 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -62,6 +62,11 @@ namespace ICSharpCode.NRefactory.TypeSystem
/// </summary>
IEnumerable<ITypeDefinition> Types { get; }
/// <summary>
/// Gets the assemblies that contribute types to this namespace (or to child namespaces).
/// </summary>
IEnumerable<IAssembly> ContributingAssemblies { get; }
/// <summary>
/// Gets a direct child namespace by its short name.
/// Returns null when the namespace cannot be found.

4
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs

@ -378,6 +378,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -378,6 +378,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return parentNamespace; }
}
IEnumerable<IAssembly> INamespace.ContributingAssemblies {
get { return new [] { assembly }; }
}
IEnumerable<INamespace> INamespace.ChildNamespaces {
get { return childNamespaces; }
}

5
ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs

@ -20,7 +20,6 @@ using System; @@ -20,7 +20,6 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using ICSharpCode.NRefactory.Utils;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
@ -96,6 +95,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -96,6 +95,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return compilation; }
}
public IEnumerable<IAssembly> ContributingAssemblies {
get { return namespaces.SelectMany(ns => ns.ContributingAssemblies); }
}
public IEnumerable<INamespace> ChildNamespaces {
get { return GetChildNamespaces().Values; }
}

Loading…
Cancel
Save