Пример #1
0
 public static string?GetFlatBufferMetadataOrNull(
     this MemberInfo memberInfo,
     FlatBufferMetadataKind kind)
 {
     return(memberInfo
            .GetCustomAttributes <FlatBufferMetadataAttribute>()
            .Where(x => x.Kind == kind)
            .FirstOrDefault()?
            .Value);
 }
Пример #2
0
 /// <summary>
 /// Initializes a new FlatBufferItemAttribute.
 /// </summary>
 /// <param name="index">The field index within the struct or table.</param>
 public FlatBufferMetadataAttribute(FlatBufferMetadataKind kind, string value)
 {
     this.Kind  = kind;
     this.Value = value;
 }