File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414using System ;
1515using System . Collections ;
1616using System . Collections . Generic ;
17+ using System . Diagnostics ;
1718using System . Runtime . InteropServices ;
1819using ExtendedSystemObjects . Helper ;
1920using ExtendedSystemObjects . Interfaces ;
@@ -27,6 +28,7 @@ namespace ExtendedSystemObjects
2728 /// Designed for scenarios where manual memory management is needed.
2829 /// </summary>
2930 /// <seealso cref="T:System.IDisposable" />
31+ [ DebuggerDisplay ( "{ToString()}" ) ]
3032 public sealed unsafe class UnmanagedIntList : IUnmanagedArray < int > , IEnumerable < int >
3133 {
3234 /// <summary>
@@ -300,6 +302,30 @@ public Span<int> AsSpan()
300302 return new Span < int > ( _ptr , Capacity ) ;
301303 }
302304
305+
306+ /// <summary>
307+ /// Converts to string.
308+ /// </summary>
309+ /// <returns>
310+ /// A <see cref="System.String" /> that represents this instance.
311+ /// </returns>
312+ public override string ToString ( )
313+ {
314+ var sb = new System . Text . StringBuilder ( ) ;
315+
316+ for ( int i = 0 ; i < Length ; i ++ )
317+ {
318+ sb . Append ( _ptr [ i ] ) ;
319+ if ( i < Length - 1 )
320+ {
321+ sb . Append ( ", " ) ;
322+ }
323+ }
324+
325+ return sb . ToString ( ) ;
326+ }
327+
328+
303329 /// <summary>
304330 /// Finalizes an instance of the <see cref="UnmanagedIntList" /> class, releasing unmanaged resources.
305331 /// </summary>
You can’t perform that action at this time.
0 commit comments