mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-27 13:33:13 +00:00
2.2
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user