2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00

Static Arrays

This commit is contained in:
2021-07-14 05:14:26 +03:00
parent d6b2a27221
commit 7940c152f0
24 changed files with 384 additions and 491 deletions

View File

@ -16,7 +16,7 @@ namespace Esiur.Proxy
{
internal static Regex urlRegex = new Regex(@"^(?:([\S]*)://([^/]*)/?)");
internal static string GenerateRecord(ResourceTemplate template, ResourceTemplate[] templates)
internal static string GenerateRecord(TypeTemplate template, TypeTemplate[] templates)
{
var cls = template.ClassName.Split('.');
@ -42,7 +42,7 @@ namespace Esiur.Proxy
return rt.ToString();
}
static string GetTypeName(TemplateDataType templateDataType, ResourceTemplate[] templates)
static string GetTypeName(TemplateDataType templateDataType, TypeTemplate[] templates)
{
if (templateDataType.Type == DataType.Resource)
@ -162,7 +162,7 @@ namespace Esiur.Proxy
}
}
internal static string GenerateClass(ResourceTemplate template, ResourceTemplate[] templates)
internal static string GenerateClass(TypeTemplate template, TypeTemplate[] templates)
{
var cls = template.ClassName.Split('.');
@ -213,7 +213,7 @@ namespace Esiur.Proxy
{
var etTypeName = GetTypeName(e.ArgumentType, templates);
rt.AppendLine($"case {e.Index}: {e.Name}?.Invoke(({etTypeName})args); break;");
eventsList.AppendLine($"public event ResourceEventHanlder<{etTypeName}> {e.Name};");
eventsList.AppendLine($"public event ResourceEventHandler<{etTypeName}> {e.Name};");
}
rt.AppendLine("}}");