@@ -310,7 +310,7 @@ protected internal interface IArraySection
310310 public virtual void Create ( uint itemsCount )
311311 {
312312 if ( itemsCount == 0 )
313- throw new ArgumentException ( "invalid" , " itemsCount" ) ;
313+ throw new ArgumentException ( "invalid" , nameof ( itemsCount ) ) ;
314314
315315 // Allocate buffer
316316 CreateCpuBuffer ( itemsCount * ItemSize ) ;
@@ -342,7 +342,7 @@ public virtual void Create(GraphicsContext ctx, uint itemsCount)
342342 CheckCurrentContext ( ctx ) ;
343343
344344 if ( itemsCount == 0 )
345- throw new ArgumentException ( "invalid" , " itemsCount" ) ;
345+ throw new ArgumentException ( "invalid" , nameof ( itemsCount ) ) ;
346346
347347 // Object already existing: resize client buffer, if any
348348 if ( CpuBufferAddress != IntPtr . Zero )
@@ -389,7 +389,7 @@ public virtual void Create(GraphicsContext ctx, uint itemsCount)
389389 public virtual void Create ( Array array , uint offset , uint count )
390390 {
391391 if ( count == 0 )
392- throw new ArgumentException ( "zero not allowed" , " count" ) ;
392+ throw new ArgumentException ( "zero not allowed" , nameof ( count ) ) ;
393393
394394 // Array element item size cannot exceed ItemSize
395395 uint arrayItemSize = CheckArrayItemSize ( array ) ;
@@ -503,7 +503,7 @@ public virtual void Create(GraphicsContext ctx, Array array, uint offset, uint c
503503 CheckCurrentContext ( ctx ) ;
504504
505505 if ( count == 0 )
506- throw new ArgumentException ( "zero not allowed" , " count" ) ;
506+ throw new ArgumentException ( "zero not allowed" , nameof ( count ) ) ;
507507
508508 // Array element item size cannot exceed ItemSize
509509 uint arrayItemSize = CheckArrayItemSize ( array ) ;
@@ -637,18 +637,18 @@ protected virtual void CopyBuffer(IntPtr buffer, Array array, uint arrayItemSize
637637 private uint CheckArrayItemSize ( Array array )
638638 {
639639 if ( array == null )
640- throw new ArgumentNullException ( " array" ) ;
640+ throw new ArgumentNullException ( nameof ( array ) ) ;
641641 if ( array . Rank != 1 )
642642 throw new ArgumentException ( String . Format ( "copying from array of rank {0} not supported" , array . Rank ) ) ;
643643
644644 Type arrayElementType = array . GetType ( ) . GetElementType ( ) ;
645645 if ( arrayElementType == null || ! arrayElementType . IsValueType )
646- throw new ArgumentException ( "invalid array element type" , " array" ) ;
646+ throw new ArgumentException ( "invalid array element type" , nameof ( array ) ) ;
647647
648648 // Array element item size cannot exceed ItemSize
649649 uint arrayItemSize = ( uint ) Marshal . SizeOf ( arrayElementType ) ;
650650 if ( arrayItemSize > ItemSize )
651- throw new ArgumentException ( "array element type too big" , " array" ) ;
651+ throw new ArgumentException ( "array element type too big" , nameof ( array ) ) ;
652652
653653 return ( arrayItemSize ) ;
654654 }
@@ -691,7 +691,7 @@ public virtual void Update(GraphicsContext ctx, Array array, uint offset, uint c
691691 CheckThisExistence ( ctx ) ;
692692
693693 if ( count == 0 )
694- throw new ArgumentException ( "zero not allowed" , " count" ) ;
694+ throw new ArgumentException ( "zero not allowed" , nameof ( count ) ) ;
695695 if ( IsMapped )
696696 throw new InvalidOperationException ( "mapped" ) ;
697697
@@ -879,15 +879,15 @@ protected static void CopyArray(
879879 uint srcIndex , uint srcCount )
880880 {
881881 if ( dst == IntPtr . Zero )
882- throw new ArgumentException ( "invalid pointer" , " dst" ) ;
882+ throw new ArgumentException ( "invalid pointer" , nameof ( dst ) ) ;
883883 if ( src == null )
884- throw new ArgumentNullException ( " src" ) ;
884+ throw new ArgumentNullException ( nameof ( src ) ) ;
885885 if ( srcItemSize > dstItemSize )
886- throw new ArgumentException ( "too large" , " srcItemSize" ) ;
886+ throw new ArgumentException ( "too large" , nameof ( srcItemSize ) ) ;
887887 if ( src . Length < srcCount )
888- throw new ArgumentException ( "exceed array length" , " srcCount" ) ;
888+ throw new ArgumentException ( "exceed array length" , nameof ( srcCount ) ) ;
889889 if ( src . Length < srcIndex + srcCount )
890- throw new ArgumentException ( "exceed array length" , " srcOffset" ) ;
890+ throw new ArgumentException ( "exceed array length" , nameof ( srcOffset ) ) ;
891891
892892 if ( srcStride == IntPtr . Zero )
893893 srcStride = new IntPtr ( srcItemSize ) ;
@@ -1026,15 +1026,15 @@ protected static void CopyArray(
10261026 uint dstIndex , uint dstCount )
10271027 {
10281028 if ( dst == null )
1029- throw new ArgumentNullException ( " dst" ) ;
1029+ throw new ArgumentNullException ( nameof ( dst ) ) ;
10301030 if ( src == IntPtr . Zero )
1031- throw new ArgumentException ( "invalid pointer" , " src" ) ;
1031+ throw new ArgumentException ( "invalid pointer" , nameof ( src ) ) ;
10321032 if ( srcItemSize > dstItemSize )
1033- throw new ArgumentException ( "too large" , " dstItemSize" ) ;
1033+ throw new ArgumentException ( "too large" , nameof ( dstItemSize ) ) ;
10341034 if ( dst . Length < dstCount )
1035- throw new ArgumentException ( "exceed array length" , " dstCount" ) ;
1035+ throw new ArgumentException ( "exceed array length" , nameof ( dstCount ) ) ;
10361036 if ( dst . Length < dstIndex + dstCount )
1037- throw new ArgumentException ( "exceed array length" , " dstOffset" ) ;
1037+ throw new ArgumentException ( "exceed array length" , nameof ( dstOffset ) ) ;
10381038
10391039 if ( srcStride == IntPtr . Zero )
10401040 srcStride = new IntPtr ( srcItemSize ) ;
0 commit comments