2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-09-13 12:43:17 +00:00
This commit is contained in:
2025-08-28 00:10:20 +03:00
parent 4c38e0e668
commit 5b7c6a864f
3 changed files with 278 additions and 231 deletions

View File

@@ -4,25 +4,17 @@ using System;
using System.Collections.Generic;
using System.Text;
namespace Esiur.Proxy;
public struct ResourceGeneratorClassInfo
{
public string Name { get; set; }
public bool HasInterface { get; set; }
public bool HasTrigger { get; set; }
public List<IFieldSymbol> Fields { get; set; }
public ITypeSymbol ClassSymbol { get; set; }
public ClassDeclarationSyntax ClassDeclaration { get; set; }
public bool IsInterfaceImplemented(Dictionary<string, ResourceGeneratorClassInfo> classes)
{
if (HasInterface)
return true;
// Are we going to generate the interface for the parent ?
var fullName = ClassSymbol.BaseType.ContainingAssembly + "." + ClassSymbol.BaseType.Name;
return classes.ContainsKey(fullName);
}
// Deprecated in incremental path. Use IsInterfaceImplemented(ResourceClassInfo, merged) instead.
public bool IsInterfaceImplemented(System.Collections.Generic.Dictionary<string, ResourceGeneratorClassInfo> classes) => HasInterface;
}