|
|
@ -153,7 +153,7 @@ internal class RoslynType : IXamlType |
|
|
.Select(method => new RoslynConstructor(method, _assembly)) |
|
|
.Select(method => new RoslynConstructor(method, _assembly)) |
|
|
.ToList(); |
|
|
.ToList(); |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlCustomAttribute> CustomAttributes { get; } = new List<IXamlCustomAttribute>(); |
|
|
public IReadOnlyList<IXamlCustomAttribute> CustomAttributes { get; } = Array.Empty<IXamlCustomAttribute>(); |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlType> GenericArguments { get; private set; } = new List<IXamlType>(); |
|
|
public IReadOnlyList<IXamlType> GenericArguments { get; private set; } = new List<IXamlType>(); |
|
|
|
|
|
|
|
|
@ -189,6 +189,8 @@ internal class RoslynType : IXamlType |
|
|
public IXamlType GetEnumUnderlyingType() => null; |
|
|
public IXamlType GetEnumUnderlyingType() => null; |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlType> GenericParameters { get; } = new List<IXamlType>(); |
|
|
public IReadOnlyList<IXamlType> GenericParameters { get; } = new List<IXamlType>(); |
|
|
|
|
|
|
|
|
|
|
|
public bool IsFunctionPointer => false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
internal class RoslynConstructor : IXamlConstructor |
|
|
internal class RoslynConstructor : IXamlConstructor |
|
|
@ -212,10 +214,10 @@ internal class RoslynConstructor : IXamlConstructor |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlType> Parameters => |
|
|
public IReadOnlyList<IXamlType> Parameters => |
|
|
_symbol.Parameters |
|
|
_symbol.Parameters |
|
|
.Select(parameter => parameter.Type) |
|
|
.Select(parameter => new RoslynParameter(_assembly, parameter).ParameterType) |
|
|
.OfType<INamedTypeSymbol>() |
|
|
|
|
|
.Select(type => new RoslynType(type, _assembly)) |
|
|
|
|
|
.ToList(); |
|
|
.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
public IXamlParameterInfo GetParameterInfo(int index) => new RoslynParameter(_assembly, _symbol.Parameters[index]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
internal class RoslynProperty : IXamlProperty |
|
|
internal class RoslynProperty : IXamlProperty |
|
|
@ -244,11 +246,27 @@ internal class RoslynProperty : IXamlProperty |
|
|
|
|
|
|
|
|
public IXamlMethod Setter => _symbol.SetMethod == null ? null : new RoslynMethod(_symbol.SetMethod, _assembly); |
|
|
public IXamlMethod Setter => _symbol.SetMethod == null ? null : new RoslynMethod(_symbol.SetMethod, _assembly); |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlCustomAttribute> CustomAttributes { get; } = new List<IXamlCustomAttribute>(); |
|
|
public IReadOnlyList<IXamlCustomAttribute> CustomAttributes { get; } = Array.Empty<IXamlCustomAttribute>(); |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlType> IndexerParameters { get; } = new List<IXamlType>(); |
|
|
public IReadOnlyList<IXamlType> IndexerParameters { get; } = new List<IXamlType>(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
internal class RoslynParameter : IXamlParameterInfo |
|
|
|
|
|
{ |
|
|
|
|
|
private readonly RoslynAssembly _assembly; |
|
|
|
|
|
private readonly IParameterSymbol _symbol; |
|
|
|
|
|
|
|
|
|
|
|
public RoslynParameter(RoslynAssembly assembly, IParameterSymbol symbol) |
|
|
|
|
|
{ |
|
|
|
|
|
_assembly = assembly; |
|
|
|
|
|
_symbol = symbol; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public string Name => _symbol.Name; |
|
|
|
|
|
public IXamlType ParameterType => new RoslynType((INamedTypeSymbol)_symbol.Type, _assembly); |
|
|
|
|
|
public IReadOnlyList<IXamlCustomAttribute> CustomAttributes => Array.Empty<IXamlCustomAttribute>(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
internal class RoslynMethod : IXamlMethod |
|
|
internal class RoslynMethod : IXamlMethod |
|
|
{ |
|
|
{ |
|
|
private readonly IMethodSymbol _symbol; |
|
|
private readonly IMethodSymbol _symbol; |
|
|
@ -277,14 +295,13 @@ internal class RoslynMethod : IXamlMethod |
|
|
public IXamlType ReturnType => new RoslynType((INamedTypeSymbol) _symbol.ReturnType, _assembly); |
|
|
public IXamlType ReturnType => new RoslynType((INamedTypeSymbol) _symbol.ReturnType, _assembly); |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlType> Parameters => |
|
|
public IReadOnlyList<IXamlType> Parameters => |
|
|
_symbol.Parameters.Select(parameter => parameter.Type) |
|
|
_symbol.Parameters.Select(parameter => new RoslynParameter(_assembly, parameter).ParameterType) |
|
|
.OfType<INamedTypeSymbol>() |
|
|
|
|
|
.Select(type => new RoslynType(type, _assembly)) |
|
|
|
|
|
.ToList(); |
|
|
.ToList(); |
|
|
|
|
|
|
|
|
public IXamlType DeclaringType => new RoslynType((INamedTypeSymbol)_symbol.ReceiverType, _assembly); |
|
|
public IXamlType DeclaringType => new RoslynType((INamedTypeSymbol)_symbol.ReceiverType, _assembly); |
|
|
|
|
|
|
|
|
public IXamlMethod MakeGenericMethod(IReadOnlyList<IXamlType> typeArguments) => null; |
|
|
public IXamlMethod MakeGenericMethod(IReadOnlyList<IXamlType> typeArguments) => null; |
|
|
|
|
|
|
|
|
public IReadOnlyList<IXamlCustomAttribute> CustomAttributes { get; } = new List<IXamlCustomAttribute>(); |
|
|
public IReadOnlyList<IXamlCustomAttribute> CustomAttributes { get; } = Array.Empty<IXamlCustomAttribute>(); |
|
|
|
|
|
public IXamlParameterInfo GetParameterInfo(int index) => new RoslynParameter(_assembly, _symbol.Parameters[index]); |
|
|
} |
|
|
} |
|
|
|