Browse Source

implement ByRef parameters in MethodTreeNode display text

pull/205/merge
Siegfried Pammer 15 years ago
parent
commit
ee0f54624c
  1. 28
      ILSpy/VB/VBLanguage.cs

28
ILSpy/VB/VBLanguage.cs

@ -499,24 +499,20 @@ namespace ICSharpCode.ILSpy.VB @@ -499,24 +499,20 @@ namespace ICSharpCode.ILSpy.VB
string TypeToString(ConvertTypeOptions options, TypeReference type, ICustomAttributeProvider typeAttributes = null)
{
var astType = AstBuilder
.ConvertType(type, typeAttributes, options)
.AcceptVisitor(new CSharpToVBConverterVisitor(new ILSpyEnvironmentProvider(CreateResolveContext(type.Resolve().Module))), null);
var envProvider = new ILSpyEnvironmentProvider(CreateResolveContext(type.Module));
var converter = new CSharpToVBConverterVisitor(envProvider);
var astType = AstBuilder.ConvertType(type, typeAttributes, options);
StringWriter w = new StringWriter();
// TODO
// if (type.IsByReference) {
// ParameterDefinition pd = typeAttributes as ParameterDefinition;
// if (pd != null && (!pd.IsIn && pd.IsOut))
// w.Write("out ");
// else
// w.Write("ref ");
//
// if (astType is ComposedType && ((ComposedType)astType).PointerRank > 0)
// ((ComposedType)astType).PointerRank--;
// }
astType.AcceptVisitor(new OutputVisitor(w, new VBFormattingOptions()), null);
if (type.IsByReference) {
w.Write("ByRef ");
if (astType is NRefactory.CSharp.ComposedType && ((NRefactory.CSharp.ComposedType)astType).PointerRank > 0)
((NRefactory.CSharp.ComposedType)astType).PointerRank--;
}
var vbAstType = astType.AcceptVisitor(converter, null);
vbAstType.AcceptVisitor(new OutputVisitor(w, new VBFormattingOptions()), null);
return w.ToString();
}
}

Loading…
Cancel
Save