Add support for Property and Method attributes (#49)

* .

* .

* P en E

* .
This commit is contained in:
Stef Heyenrath
2022-12-17 13:36:41 +01:00
committed by GitHub
parent a1a283c8bb
commit e22cec1b62
19 changed files with 535 additions and 31 deletions
@@ -110,6 +110,11 @@ using System;
propertyName = $"this[{string.Join(", ", methodParameters)}]";
}
foreach (var attribute in property.GetAttributesAsList())
{
str.AppendLine($" {attribute}");
}
str.AppendLine($" {getterSetter.Value.PropertyType} {propertyName} {getterSetter.Value.GetSet}");
str.AppendLine();
}
@@ -125,6 +130,11 @@ using System;
var methodParameters = GetMethodParameters(method.Parameters, true);
var whereStatement = GetWhereStatementFromMethod(method);
foreach (var attribute in method.GetAttributesAsList())
{
str.AppendLine($" {attribute}");
}
str.AppendLine($" {GetReplacedType(method.ReturnType, out _)} {method.GetMethodNameWithOptionalTypeParameters()}({string.Join(", ", methodParameters)}){whereStatement};");
str.AppendLine();
}
@@ -139,6 +149,12 @@ using System;
{
var ps = @event.First().Parameters.First();
var type = ps.GetTypeEnum() == TypeEnum.Complex ? GetParameterType(ps, out _) : ps.Type.ToString();
foreach (var attribute in ps.GetAttributesAsList())
{
str.AppendLine($" {attribute}");
}
str.AppendLine($" event {type} {@event.Key.GetSanitizedName()};");
str.AppendLine();
}