2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00
This commit is contained in:
2022-03-09 21:55:30 +03:00
parent 530df018ec
commit 9a174f406f
106 changed files with 5166 additions and 4398 deletions

View File

@ -19,17 +19,23 @@ public class EventTemplate : MemberTemplate
public EventInfo EventInfo { get; set; }
public TemplateDataType ArgumentType { get; set; }
public RepresentationType ArgumentType { get; set; }
public override byte[] Compose()
{
var name = base.Compose();
var hdr = Inherited ? (byte)0x80 : (byte)0;
if (Listenable)
hdr |= 0x8;
if (Expansion != null)
{
var exp = DC.ToBytes(Expansion);
hdr |= 0x50;
return new BinaryList()
.AddUInt8(Listenable ? (byte)0x58 : (byte)0x50)
.AddUInt8(hdr)
.AddUInt8((byte)name.Length)
.AddUInt8Array(name)
.AddUInt8Array(ArgumentType.Compose())
@ -38,17 +44,17 @@ public class EventTemplate : MemberTemplate
.ToArray();
}
else
hdr |= 0x40;
return new BinaryList()
.AddUInt8(Listenable ? (byte)0x48 : (byte)0x40)
.AddUInt8(hdr)
.AddUInt8((byte)name.Length)
.AddUInt8Array(name)
.AddUInt8Array(ArgumentType.Compose())
.ToArray();
}
public EventTemplate(TypeTemplate template, byte index, string name, TemplateDataType argumentType, string expansion = null, bool listenable = false)
: base(template, MemberType.Property, index, name)
public EventTemplate(TypeTemplate template, byte index, string name,bool inherited, RepresentationType argumentType, string expansion = null, bool listenable = false)
: base(template, index, name, inherited)
{
this.Expansion = expansion;
this.Listenable = listenable;