1 | // Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team |
---|
2 | // |
---|
3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this |
---|
4 | // software and associated documentation files (the "Software"), to deal in the Software |
---|
5 | // without restriction, including without limitation the rights to use, copy, modify, merge, |
---|
6 | // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons |
---|
7 | // to whom the Software is furnished to do so, subject to the following conditions: |
---|
8 | // |
---|
9 | // The above copyright notice and this permission notice shall be included in all copies or |
---|
10 | // substantial portions of the Software. |
---|
11 | // |
---|
12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
---|
13 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
---|
14 | // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE |
---|
15 | // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
---|
16 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
---|
17 | // DEALINGS IN THE SOFTWARE. |
---|
18 | |
---|
19 | using System; |
---|
20 | using System.Collections.Generic; |
---|
21 | |
---|
22 | namespace ICSharpCode.NRefactory.TypeSystem |
---|
23 | { |
---|
24 | /// <summary> |
---|
25 | /// Represents a resolved namespace. |
---|
26 | /// </summary> |
---|
27 | public interface INamespace : ISymbol, ICompilationProvider |
---|
28 | { |
---|
29 | // No pointer back to unresolved namespace: |
---|
30 | // multiple unresolved namespaces (from different assemblies) get |
---|
31 | // merged into one INamespace. |
---|
32 | |
---|
33 | /// <summary> |
---|
34 | /// Gets the extern alias for this namespace. |
---|
35 | /// Returns an empty string for normal namespaces. |
---|
36 | /// </summary> |
---|
37 | string ExternAlias { get; } |
---|
38 | |
---|
39 | /// <summary> |
---|
40 | /// Gets the full name of this namespace. (e.g. "System.Collections") |
---|
41 | /// </summary> |
---|
42 | string FullName { get; } |
---|
43 | |
---|
44 | /// <summary> |
---|
45 | /// Gets the short name of this namespace (e.g. "Collections"). |
---|
46 | /// </summary> |
---|
47 | new string Name { get; } |
---|
48 | |
---|
49 | /// <summary> |
---|
50 | /// Gets the parent namespace. |
---|
51 | /// Returns null if this is the root namespace. |
---|
52 | /// </summary> |
---|
53 | INamespace ParentNamespace { get; } |
---|
54 | |
---|
55 | /// <summary> |
---|
56 | /// Gets the child namespaces in this namespace. |
---|
57 | /// </summary> |
---|
58 | IEnumerable<INamespace> ChildNamespaces { get; } |
---|
59 | |
---|
60 | /// <summary> |
---|
61 | /// Gets the types in this namespace. |
---|
62 | /// </summary> |
---|
63 | IEnumerable<ITypeDefinition> Types { get; } |
---|
64 | |
---|
65 | /// <summary> |
---|
66 | /// Gets the assemblies that contribute types to this namespace (or to child namespaces). |
---|
67 | /// </summary> |
---|
68 | IEnumerable<IAssembly> ContributingAssemblies { get; } |
---|
69 | |
---|
70 | /// <summary> |
---|
71 | /// Gets a direct child namespace by its short name. |
---|
72 | /// Returns null when the namespace cannot be found. |
---|
73 | /// </summary> |
---|
74 | /// <remarks> |
---|
75 | /// This method uses the compilation's current string comparer. |
---|
76 | /// </remarks> |
---|
77 | INamespace GetChildNamespace(string name); |
---|
78 | |
---|
79 | /// <summary> |
---|
80 | /// Gets the type with the specified short name and type parameter count. |
---|
81 | /// Returns null if the type cannot be found. |
---|
82 | /// </summary> |
---|
83 | /// <remarks> |
---|
84 | /// This method uses the compilation's current string comparer. |
---|
85 | /// </remarks> |
---|
86 | ITypeDefinition GetTypeDefinition(string name, int typeParameterCount); |
---|
87 | } |
---|
88 | } |
---|