Example #1
0
    /// <summary>
    /// Initializes a new instance of the <see cref="TransferBufferDebugView{T}"/> class with the specified parameters.
    /// </summary>
    /// <param name="buffer">The input <see cref="TransferBuffer{T}"/> instance with the items to display.</param>
    public TransferBufferDebugView(TransferBuffer <T>?buffer)
    {
        if (buffer is not null)
        {
            T[] items = GC.AllocateUninitializedArray <T>(buffer.Length);

            buffer.Span.CopyTo(items);

            Items = items;
        }
    }
Example #2
0
    /// <summary>
    /// Initializes a new instance of the <see cref="BufferDebugView{T}"/> class with the specified parameters.
    /// </summary>
    /// <param name="buffer">The input <see cref="Buffer{T}"/> instance with the items to display.</param>
    public BufferDebugView(Buffer <T>?buffer)
    {
        if (buffer is not null)
        {
            T[] items = GC.AllocateUninitializedArray <T>(buffer.Length);

            buffer.CopyTo(ref items[0], 0, buffer.Length);

            Items = items;
        }
    }