/// <summary> /// Constructor /// </summary> /// <param name="tableName">Name of table</param> /// <param name="token">Token</param> /// <param name="span">Span</param> /// <param name="fields">Fields</param> /// <param name="tablesHeap">Owner heap</param> public TableRecordData(string tableName, MDToken token, HexBufferSpan span, BufferField[] fields, TablesHeap tablesHeap) : base(tableName, span) { if (fields == null) { throw new ArgumentNullException(nameof(fields)); } if (fields.Length == 0) { throw new ArgumentOutOfRangeException(nameof(fields)); } if (tablesHeap == null) { throw new ArgumentNullException(nameof(tablesHeap)); } Token = token; Fields = fields; TablesHeap = tablesHeap; }
/// <summary> /// Encodes a token /// </summary> /// <param name="token">The token</param> /// <param name="codedToken">Coded token</param> /// <returns><c>true</c> if successful</returns> public bool Encode(MDToken token, out uint codedToken) { return(Encode(token.Raw, out codedToken)); }
/// <summary> /// Encodes a token /// </summary> /// <param name="token">The token</param> /// <returns>Coded token</returns> /// <seealso cref="Encode(MDToken,out uint)"/> public uint Encode(MDToken token) { return(Encode(token.Raw)); }
/// <summary> /// Encodes a token /// </summary> /// <param name="token">The token</param> /// <param name="codedToken">Coded token</param> /// <returns><c>true</c> if successful</returns> public bool Encode(MDToken token, out uint codedToken) => Encode(token.Raw, out codedToken);
/// <summary> /// Encodes a token /// </summary> /// <param name="token">The token</param> /// <returns>Coded token</returns> /// <seealso cref="Encode(MDToken,out uint)"/> public uint Encode(MDToken token) => Encode(token.Raw);
/// <summary> /// Constructor /// </summary> /// <param name="resourceProvider">Owner</param> /// <param name="span">Span</param> /// <param name="token">Token</param> protected DotNetEmbeddedResource(DotNetResourceProvider resourceProvider, HexBufferSpan span, uint token) : base(NAME, span) { ResourceProvider = resourceProvider ?? throw new ArgumentNullException(nameof(resourceProvider)); Token = new MDToken(token); }
/// <summary> /// Gets a record or null if <paramref name="token"/> is invalid /// </summary> /// <param name="token">Token</param> /// <returns></returns> public abstract TableRecordData GetRecord(MDToken token);