mirror of
				https://github.com/esiur/esiur-dotnet.git
				synced 2025-10-30 23:51:34 +00:00 
			
		
		
		
	null annotations
This commit is contained in:
		| @@ -84,7 +84,8 @@ public static class TemplateGenerator | ||||
|         foreach (var p in template.Properties) | ||||
|         { | ||||
|             var ptTypeName = GetTypeName(p.ValueType, templates); | ||||
|             rt.AppendLine($"[Annotation({ToLiteral(p.ReadAnnotation)})]"); | ||||
|             if (p.ReadAnnotation != null) | ||||
|                 rt.AppendLine($"[Annotation({ToLiteral(p.ReadAnnotation)})]"); | ||||
|             rt.AppendLine($"public {ptTypeName} {p.Name} {{ get; set; }}"); | ||||
|             rt.AppendLine(); | ||||
|         } | ||||
| @@ -297,7 +298,8 @@ public static class TemplateGenerator | ||||
|             var positionalArgs = f.Arguments.Where((x) => !x.Optional).ToArray(); | ||||
|             var optionalArgs = f.Arguments.Where((x) => x.Optional).ToArray(); | ||||
|  | ||||
|             rt.AppendLine($"[Annotation({ToLiteral(f.Annotation)})]"); | ||||
|             if (f.Annotation != null) | ||||
|                 rt.AppendLine($"[Annotation({ToLiteral(f.Annotation)})]"); | ||||
|  | ||||
|             if (f.IsStatic) | ||||
|             { | ||||
| @@ -361,7 +363,8 @@ public static class TemplateGenerator | ||||
|             if (p.Inherited) | ||||
|                 continue; | ||||
|  | ||||
|             rt.AppendLine($"[Annotation({ToLiteral(p.ReadAnnotation)})]"); | ||||
|             if (p.ReadAnnotation != null) | ||||
|                 rt.AppendLine($"[Annotation({ToLiteral(p.ReadAnnotation)})]"); | ||||
|  | ||||
|             var ptTypeName = GetTypeName(p.ValueType, templates); | ||||
|             rt.AppendLine($"[Export] public {ptTypeName} {p.Name} {{"); | ||||
| @@ -378,7 +381,8 @@ public static class TemplateGenerator | ||||
|             if (c.Inherited) | ||||
|                 continue; | ||||
|  | ||||
|             rt.AppendLine($"[Annotation({ToLiteral(c.Annotation)})]"); | ||||
|             if (c.Annotation != null) | ||||
|                 rt.AppendLine($"[Annotation({ToLiteral(c.Annotation)})]"); | ||||
|  | ||||
|             var ctTypeName = GetTypeName(c.ValueType, templates); | ||||
|             rt.AppendLine($"[Export] public const {ctTypeName} {c.Name} = {c.Value};"); | ||||
| @@ -398,7 +402,9 @@ public static class TemplateGenerator | ||||
|                 var etTypeName = GetTypeName(e.ArgumentType, templates); | ||||
|                 rt.AppendLine($"case {e.Index}: {e.Name}?.Invoke(({etTypeName})args); break;"); | ||||
|  | ||||
|                 eventsList.AppendLine($"[Annotation({ToLiteral(e.Annotation)})]"); | ||||
|                 if (e.Annotation != null) | ||||
|                     eventsList.AppendLine($"[Annotation({ToLiteral(e.Annotation)})]"); | ||||
|  | ||||
|                 eventsList.AppendLine($"[Export] public event ResourceEventHandler<{etTypeName}> {e.Name};"); | ||||
|             } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user