mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-07-31 01:40:42 +00:00
Managers
This commit is contained in:
@@ -209,12 +209,14 @@ public class EventDef : MemberDef
|
||||
|
||||
return DefinitionAttributeReader.Apply(ei, new EventDef()
|
||||
{
|
||||
Definition = schema,
|
||||
Name = name,
|
||||
ArgumentType = evtType,
|
||||
Index = index,
|
||||
Inherited = ei.DeclaringType != type,
|
||||
Annotations = annotations,
|
||||
EventInfo = ei,
|
||||
MemberPolicyAttributes = Attribute.GetCustomAttributes(ei, true),
|
||||
AutoDelivered = autoDeliveryAttr != null,
|
||||
Historical = historicalAttr != null,
|
||||
OrderingControl = orderingAttr?.Control ?? OrderingControl.Strict,
|
||||
|
||||
@@ -367,6 +367,7 @@ public class FunctionDef : MemberDef
|
||||
|
||||
return DefinitionAttributeReader.Apply(mi, new FunctionDef()
|
||||
{
|
||||
Definition = schema,
|
||||
Name = name,
|
||||
Index = index,
|
||||
Inherited = mi.DeclaringType != type,
|
||||
@@ -379,6 +380,7 @@ public class FunctionDef : MemberDef
|
||||
Idempotent = mi.GetCustomAttribute<IdempotentAttribute>(true) != null,
|
||||
Cancellable = mi.GetCustomAttribute<CancellableAttribute>(true) != null,
|
||||
RatePolicyName = mi.GetCustomAttribute<RateControlAttribute>(true)?.PolicyName,
|
||||
MemberPolicyAttributes = Attribute.GetCustomAttributes(mi, true),
|
||||
StreamMode = streamMode,
|
||||
Pausable = pausable,
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||
namespace Esiur.Data.Types;
|
||||
public class MemberDef
|
||||
{
|
||||
IReadOnlyList<Attribute> memberPolicyAttributes = Array.Empty<Attribute>();
|
||||
|
||||
// Core fields
|
||||
public byte Index { get; set; }
|
||||
@@ -24,6 +25,18 @@ public class MemberDef
|
||||
/// </summary>
|
||||
public string? RatePolicyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Local reflection attributes supplied to resource managers while this member
|
||||
/// is evaluated. This execution metadata is not serialized to remote peers.
|
||||
/// </summary>
|
||||
public IReadOnlyList<Attribute> MemberPolicyAttributes
|
||||
{
|
||||
get => memberPolicyAttributes;
|
||||
internal set => memberPolicyAttributes = value is null
|
||||
? Array.Empty<Attribute>()
|
||||
: Array.AsReadOnly(value.ToArray());
|
||||
}
|
||||
|
||||
public TypeDef Definition { get; set; } = null!;
|
||||
|
||||
// Human-readable metadata
|
||||
|
||||
@@ -312,12 +312,17 @@ public class PropertyDef : MemberDef
|
||||
|
||||
return DefinitionAttributeReader.Apply(pi, new PropertyDef()
|
||||
{
|
||||
Definition = typeDef,
|
||||
Name = name,
|
||||
Index = index,
|
||||
Inherited = pi.DeclaringType != type,
|
||||
ValueType = propType,
|
||||
PropertyInfo = pi,
|
||||
RatePolicyName = pi.GetCustomAttribute<RateControlAttribute>(true)?.PolicyName,
|
||||
RatePolicyName = (Attribute.GetCustomAttribute(
|
||||
pi,
|
||||
typeof(RateControlAttribute),
|
||||
true) as RateControlAttribute)?.PolicyName,
|
||||
MemberPolicyAttributes = Attribute.GetCustomAttributes(pi, true),
|
||||
ReadOnly = readOnlyAttr != null,
|
||||
Volatile = volatileAttr != null,
|
||||
Historical = historicalAttr != null,
|
||||
|
||||
Reference in New Issue
Block a user