|
|
|
@ -78,7 +78,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
@@ -78,7 +78,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
|
|
|
|
|
|
|
|
|
|
public FindRequiredImports(TransformContext context) |
|
|
|
|
{ |
|
|
|
|
this.currentNamespace = context.DecompiledTypeDefinition != null ? context.DecompiledTypeDefinition.Namespace : string.Empty; |
|
|
|
|
this.currentNamespace = context.DecompiledTypeDefinition?.Namespace ?? string.Empty; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool IsParentOfCurrentNamespace(string ns) |
|
|
|
@ -123,7 +123,12 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
@@ -123,7 +123,12 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
|
|
|
|
|
public FullyQualifyAmbiguousTypeNamesVisitor(TransformContext context, UsingScope usingScope) |
|
|
|
|
{ |
|
|
|
|
this.context = new Stack<CSharpTypeResolveContext>(); |
|
|
|
|
var currentContext = new CSharpTypeResolveContext(context.TypeSystem.MainAssembly, usingScope.Resolve(context.TypeSystem.Compilation)); |
|
|
|
|
if (!string.IsNullOrEmpty(context.DecompiledTypeDefinition?.Namespace)) { |
|
|
|
|
foreach (string ns in context.DecompiledTypeDefinition.Namespace.Split('.')) { |
|
|
|
|
usingScope = new UsingScope(usingScope, ns); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
var currentContext = new CSharpTypeResolveContext(context.TypeSystem.MainAssembly, usingScope.Resolve(context.TypeSystem.Compilation), context.DecompiledTypeDefinition); |
|
|
|
|
this.context.Push(currentContext); |
|
|
|
|
this.astBuilder = CreateAstBuilder(currentContext); |
|
|
|
|
} |
|
|
|
|