mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-09-13 12:43:17 +00:00
V3
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<Copyright>Ahmed Kh. Zamil</Copyright>
|
||||
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Version>2.4.13</Version>
|
||||
<Version>3.0.0</Version>
|
||||
<RepositoryUrl>https://github.com/esiur/esiur-dotnet</RepositoryUrl>
|
||||
<Authors>Ahmed Kh. Zamil</Authors>
|
||||
<AssemblyVersion></AssemblyVersion>
|
||||
@@ -16,15 +16,16 @@
|
||||
<PackageId>Esiur</PackageId>
|
||||
<Product>Esiur</Product>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<IsRoslynComponent>true</IsRoslynComponent>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<DefineConstants>TRACE;DEBUG;NETSTANDARD</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
@@ -43,7 +44,7 @@
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
|
||||
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.6" GeneratePathProperty="true" />
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.8" GeneratePathProperty="true" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2024 Esiur Foundation, Ahmed Kh. Zamil.
|
||||
Copyright (c) 2017-2025 Esiur Foundation, Ahmed Kh. Zamil.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@@ -81,7 +81,7 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
||||
// Fields
|
||||
bool invalidCredentials = false;
|
||||
|
||||
Timer keepAliveTimer;
|
||||
System.Timers.Timer keepAliveTimer;
|
||||
DateTime? lastKeepAliveSent;
|
||||
DateTime? lastKeepAliveReceived;
|
||||
|
||||
@@ -362,12 +362,11 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
||||
// set local nonce
|
||||
session.LocalHeaders[IIPAuthPacketHeader.Nonce] = Global.GenerateBytes(32);
|
||||
|
||||
keepAliveTimer = new Timer(KeepAliveInterval * 1000);
|
||||
keepAliveTimer.Elapsed += KeepAliveTimer_Elapsed;
|
||||
keepAliveTimer = new System.Timers.Timer(KeepAliveInterval * 1000);
|
||||
keepAliveTimer.Elapsed += KeepAliveTimer_Elapsed; ;
|
||||
}
|
||||
|
||||
|
||||
private void KeepAliveTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
private void KeepAliveTimer_Elapsed(object? sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (!IsConnected)
|
||||
return;
|
||||
|
@@ -174,17 +174,17 @@ $@" public partial class {ci.Name} : IResource {{
|
||||
|
||||
classInfo = new ResourceClassInfo
|
||||
(
|
||||
Key: key,
|
||||
Name: cls.Name,
|
||||
ClassDeclaration: cds,
|
||||
ClassSymbol: cls,
|
||||
Fields: exportedFields,
|
||||
HasInterface: hasInterface,
|
||||
HasTrigger: hasTrigger
|
||||
key,
|
||||
cls.Name,
|
||||
cds,
|
||||
cls,
|
||||
exportedFields,
|
||||
hasInterface,
|
||||
hasTrigger
|
||||
);
|
||||
}
|
||||
|
||||
return new PerClass(importUrls, classInfo);
|
||||
return new PerClass(classInfo, importUrls);
|
||||
}
|
||||
|
||||
private static ImmutableArray<ResourceClassInfo> MergePartials(ImmutableArray<ResourceClassInfo> list)
|
||||
@@ -294,19 +294,39 @@ $@" public partial class {ci.Name} : IResource {{
|
||||
}
|
||||
|
||||
// === Data carriers for the pipeline ===
|
||||
private readonly record struct PerClass(
|
||||
ImmutableArray<string> ImportUrls,
|
||||
ResourceClassInfo? ClassInfo
|
||||
);
|
||||
private readonly record struct PerClass {
|
||||
public PerClass(ResourceClassInfo? classInfo, ImmutableArray<string> importUrls)
|
||||
{
|
||||
this.ImportUrls = importUrls;
|
||||
this.ClassInfo = classInfo;
|
||||
}
|
||||
|
||||
private sealed record ResourceClassInfo(
|
||||
string Key,
|
||||
string Name,
|
||||
ClassDeclarationSyntax ClassDeclaration,
|
||||
ITypeSymbol ClassSymbol,
|
||||
List<IFieldSymbol> Fields,
|
||||
bool HasInterface,
|
||||
bool HasTrigger
|
||||
);
|
||||
public readonly ImmutableArray<string> ImportUrls;
|
||||
public readonly ResourceClassInfo? ClassInfo;
|
||||
}
|
||||
|
||||
private sealed record ResourceClassInfo {
|
||||
|
||||
public ResourceClassInfo(string key, string name ,
|
||||
ClassDeclarationSyntax classDeclaration,
|
||||
ITypeSymbol classSymbol, List<IFieldSymbol> fileds, bool hasInterface, bool hasTrigger)
|
||||
{
|
||||
Key = key;
|
||||
Name = name;
|
||||
ClassDeclaration = classDeclaration;
|
||||
ClassSymbol = classSymbol;
|
||||
Fields = fileds;
|
||||
HasInterface = hasInterface;
|
||||
HasTrigger = hasTrigger;
|
||||
}
|
||||
|
||||
public string Key;
|
||||
public string Name;
|
||||
public ClassDeclarationSyntax ClassDeclaration;
|
||||
public ITypeSymbol ClassSymbol;
|
||||
public List<IFieldSymbol> Fields;
|
||||
public bool HasInterface;
|
||||
public bool HasTrigger;
|
||||
}
|
||||
}
|
||||
}
|
@@ -82,7 +82,7 @@ public static class ResourceProxy
|
||||
|
||||
var props = from p in type.GetProperties()
|
||||
where p.CanWrite && p.GetSetMethod().IsVirtual &&
|
||||
p.GetCustomAttributes(typeof(ResourceProperty), false).Count() > 0
|
||||
p.GetCustomAttributes(typeof(ExportAttribute), false).Count() > 0
|
||||
select p;
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user