|
|
|
@ -18,7 +18,7 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
public class ReflectionProjectContent : DefaultProjectContent |
|
|
|
public class ReflectionProjectContent : DefaultProjectContent |
|
|
|
{ |
|
|
|
{ |
|
|
|
string assemblyFullName; |
|
|
|
string assemblyFullName; |
|
|
|
AssemblyName[] referencedAssemblies; |
|
|
|
DomAssemblyName[] referencedAssemblyNames; |
|
|
|
ICompilationUnit assemblyCompilationUnit; |
|
|
|
ICompilationUnit assemblyCompilationUnit; |
|
|
|
string assemblyLocation; |
|
|
|
string assemblyLocation; |
|
|
|
ProjectContentRegistry registry; |
|
|
|
ProjectContentRegistry registry; |
|
|
|
@ -35,16 +35,20 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Obsolete("This property always returns an empty array! Use ReferencedAssemblyNames instead!")] |
|
|
|
public AssemblyName[] ReferencedAssemblies { |
|
|
|
public AssemblyName[] ReferencedAssemblies { |
|
|
|
get { |
|
|
|
get { return new AssemblyName[0]; } |
|
|
|
return referencedAssemblies; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets the list of assembly names referenced by this project content.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public IList<DomAssemblyName> ReferencedAssemblyNames { |
|
|
|
|
|
|
|
get { return Array.AsReadOnly(referencedAssemblyNames); } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ICompilationUnit AssemblyCompilationUnit { |
|
|
|
public ICompilationUnit AssemblyCompilationUnit { |
|
|
|
get { |
|
|
|
get { return assemblyCompilationUnit; } |
|
|
|
return assemblyCompilationUnit; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DateTime assemblyFileLastWriteTime; |
|
|
|
DateTime assemblyFileLastWriteTime; |
|
|
|
@ -73,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ReflectionProjectContent(Assembly assembly, string assemblyLocation, ProjectContentRegistry registry) |
|
|
|
public ReflectionProjectContent(Assembly assembly, string assemblyLocation, ProjectContentRegistry registry) |
|
|
|
: this(assembly.FullName, assemblyLocation, assembly.GetReferencedAssemblies(), registry) |
|
|
|
: this(assembly.FullName, assemblyLocation, DomAssemblyName.Convert(assembly.GetReferencedAssemblies()), registry) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (Type type in assembly.GetExportedTypes()) { |
|
|
|
foreach (Type type in assembly.GetExportedTypes()) { |
|
|
|
string name = type.FullName; |
|
|
|
string name = type.FullName; |
|
|
|
@ -84,7 +88,13 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
InitializeSpecialClasses(); |
|
|
|
InitializeSpecialClasses(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Obsolete("Use DomAssemblyName instead of AssemblyName!")] |
|
|
|
public ReflectionProjectContent(string assemblyFullName, string assemblyLocation, AssemblyName[] referencedAssemblies, ProjectContentRegistry registry) |
|
|
|
public ReflectionProjectContent(string assemblyFullName, string assemblyLocation, AssemblyName[] referencedAssemblies, ProjectContentRegistry registry) |
|
|
|
|
|
|
|
: this(assemblyFullName, assemblyLocation, DomAssemblyName.Convert(referencedAssemblies), registry) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ReflectionProjectContent(string assemblyFullName, string assemblyLocation, DomAssemblyName[] referencedAssemblies, ProjectContentRegistry registry) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (assemblyFullName == null) |
|
|
|
if (assemblyFullName == null) |
|
|
|
throw new ArgumentNullException("assemblyFullName"); |
|
|
|
throw new ArgumentNullException("assemblyFullName"); |
|
|
|
@ -95,7 +105,7 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
|
|
|
|
|
|
|
|
this.registry = registry; |
|
|
|
this.registry = registry; |
|
|
|
this.assemblyFullName = assemblyFullName; |
|
|
|
this.assemblyFullName = assemblyFullName; |
|
|
|
this.referencedAssemblies = referencedAssemblies; |
|
|
|
this.referencedAssemblyNames = referencedAssemblies; |
|
|
|
this.assemblyLocation = assemblyLocation; |
|
|
|
this.assemblyLocation = assemblyLocation; |
|
|
|
this.assemblyCompilationUnit = new DefaultCompilationUnit(this); |
|
|
|
this.assemblyCompilationUnit = new DefaultCompilationUnit(this); |
|
|
|
|
|
|
|
|
|
|
|
@ -146,7 +156,7 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool initialized = false; |
|
|
|
bool initialized = false; |
|
|
|
List<AssemblyName> missingNames; |
|
|
|
List<DomAssemblyName> missingNames; |
|
|
|
|
|
|
|
|
|
|
|
public void InitializeReferences() |
|
|
|
public void InitializeReferences() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -169,7 +179,7 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
initialized = true; |
|
|
|
initialized = true; |
|
|
|
foreach (AssemblyName name in referencedAssemblies) { |
|
|
|
foreach (DomAssemblyName name in referencedAssemblyNames) { |
|
|
|
IProjectContent content = registry.GetExistingProjectContent(name); |
|
|
|
IProjectContent content = registry.GetExistingProjectContent(name); |
|
|
|
if (content != null) { |
|
|
|
if (content != null) { |
|
|
|
changed = true; |
|
|
|
changed = true; |
|
|
|
@ -178,7 +188,7 @@ namespace ICSharpCode.SharpDevelop.Dom |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (missingNames == null) |
|
|
|
if (missingNames == null) |
|
|
|
missingNames = new List<AssemblyName>(); |
|
|
|
missingNames = new List<DomAssemblyName>(); |
|
|
|
missingNames.Add(name); |
|
|
|
missingNames.Add(name); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|