Implement Complex

This commit is contained in:
Stef Heyenrath
2021-07-25 11:16:48 +02:00
parent 9326899151
commit e00c0c7706
9 changed files with 51 additions and 16 deletions
@@ -39,6 +39,15 @@ namespace ProxyInterfaceSourceGenerator.Extensions
return $"{property.Type} {property.Name} {{ {get}{set}}}";
}
public static string ToPropertyTextForClass(this IPropertySymbol property, string interfaceName, string className)
{
var classNameProxy = $"{className}Proxy";
var get = property.GetMethod != null ? $"get => new {classNameProxy}(_Instance.{property.Name}); " : string.Empty;
var set = property.SetMethod != null ? $"set => _Instance.{property.Name} = (({classNameProxy}) value)._Instance; " : string.Empty;
return $"{interfaceName} {property.Name} {{ {get}{set}}}";
}
public static string ToMethodText(this IMethodSymbol method)
{
var parameters = new List<string>();