@@ -404,7 +404,7 @@ public EventSourceSettings Settings
404
404
public static Guid GetGuid ( Type eventSourceType )
405
405
{
406
406
if ( eventSourceType == null )
407
- throw new ArgumentNullException ( " eventSourceType" ) ;
407
+ throw new ArgumentNullException ( nameof ( eventSourceType ) ) ;
408
408
Contract . EndContractBlock ( ) ;
409
409
410
410
EventSourceAttribute attrib = ( EventSourceAttribute ) GetCustomAttributeHelper ( eventSourceType , typeof ( EventSourceAttribute ) ) ;
@@ -429,7 +429,7 @@ public static Guid GetGuid(Type eventSourceType)
429
429
430
430
if ( name == null )
431
431
{
432
- throw new ArgumentException ( Resources . GetResourceString ( "Argument_InvalidTypeName" ) , " eventSourceType" ) ;
432
+ throw new ArgumentException ( Resources . GetResourceString ( "Argument_InvalidTypeName" ) , nameof ( eventSourceType ) ) ;
433
433
}
434
434
return GenerateGuidFromName ( name . ToUpperInvariant ( ) ) ; // Make it case insensitive.
435
435
}
@@ -472,7 +472,7 @@ public static string GenerateManifest(Type eventSourceType, string assemblyPathT
472
472
public static string GenerateManifest ( Type eventSourceType , string assemblyPathToIncludeInManifest , EventManifestOptions flags )
473
473
{
474
474
if ( eventSourceType == null )
475
- throw new ArgumentNullException ( " eventSourceType" ) ;
475
+ throw new ArgumentNullException ( nameof ( eventSourceType ) ) ;
476
476
Contract . EndContractBlock ( ) ;
477
477
478
478
byte [ ] manifestBytes = EventSource . CreateManifestAndDescriptors ( eventSourceType , assemblyPathToIncludeInManifest , null , flags ) ;
@@ -511,12 +511,12 @@ public static IEnumerable<EventSource> GetSources()
511
511
public static void SendCommand ( EventSource eventSource , EventCommand command , IDictionary < string , string > commandArguments )
512
512
{
513
513
if ( eventSource == null )
514
- throw new ArgumentNullException ( " eventSource" ) ;
514
+ throw new ArgumentNullException ( nameof ( eventSource ) ) ;
515
515
516
516
// User-defined EventCommands should not conflict with the reserved commands.
517
517
if ( ( int ) command <= ( int ) EventCommand . Update && ( int ) command != ( int ) EventCommand . SendManifest )
518
518
{
519
- throw new ArgumentException ( Resources . GetResourceString ( "EventSource_InvalidCommand" ) , " command" ) ;
519
+ throw new ArgumentException ( Resources . GetResourceString ( "EventSource_InvalidCommand" ) , nameof ( command ) ) ;
520
520
}
521
521
522
522
eventSource . SendCommand ( null , 0 , 0 , command , true , EventLevel . LogAlways , EventKeywords . None , commandArguments ) ;
@@ -1451,7 +1451,7 @@ private unsafe void Initialize(Guid eventSourceGuid, string eventSourceName, str
1451
1451
m_traits = traits ;
1452
1452
if ( m_traits != null && m_traits . Length % 2 != 0 )
1453
1453
{
1454
- throw new ArgumentException ( Resources . GetResourceString ( "TraitEven" ) , " traits" ) ;
1454
+ throw new ArgumentException ( Resources . GetResourceString ( "TraitEven" ) , nameof ( traits ) ) ;
1455
1455
}
1456
1456
1457
1457
if ( eventSourceGuid == Guid . Empty )
@@ -1543,7 +1543,7 @@ private unsafe void Initialize(Guid eventSourceGuid, string eventSourceName, str
1543
1543
private static string GetName ( Type eventSourceType , EventManifestOptions flags )
1544
1544
{
1545
1545
if ( eventSourceType == null )
1546
- throw new ArgumentNullException ( " eventSourceType" ) ;
1546
+ throw new ArgumentNullException ( nameof ( eventSourceType ) ) ;
1547
1547
Contract . EndContractBlock ( ) ;
1548
1548
1549
1549
EventSourceAttribute attrib = ( EventSourceAttribute ) GetCustomAttributeHelper ( eventSourceType , typeof ( EventSourceAttribute ) , flags ) ;
@@ -3672,7 +3672,7 @@ private static void AddEventDescriptor(ref EventMetadata[] eventData, string eve
3672
3672
if ( eventData == null || eventData. Length <= eventAttribute. EventId)
3673
3673
{
3674
3674
EventMetadata[ ] newValues = new EventMetadata[ Math. Max( eventData. Length + 16 , eventAttribute. EventId + 1 ) ] ;
3675
- Array. Copy( eventData, newValues, eventData. Length) ;
3675
+ Array. Copy( eventData, 0 , newValues, 0 , eventData. Length) ;
3676
3676
eventData = newValues;
3677
3677
}
3678
3678
@@ -3711,7 +3711,7 @@ private static void TrimEventDescriptors(ref EventMetadata[] eventData)
3711
3711
if ( eventData. Length - idx > 2 ) // allow one wasted slot.
3712
3712
{
3713
3713
EventMetadata[ ] newValues = new EventMetadata[ idx + 1 ] ;
3714
- Array. Copy( eventData, newValues, newValues. Length) ;
3714
+ Array. Copy( eventData, 0 , newValues, 0 , newValues. Length) ;
3715
3715
eventData = newValues;
3716
3716
}
3717
3717
}
@@ -3994,7 +3994,7 @@ private EventSourceSettings ValidateSettings(EventSourceSettings settings)
3994
3994
EventSourceSettings. EtwSelfDescribingEventFormat;
3995
3995
if ( ( settings & evtFormatMask) == evtFormatMask)
3996
3996
{
3997
- throw new ArgumentException( Resources. GetResourceString( "EventSource_InvalidEventFormat") , " settings" ) ;
3997
+ throw new ArgumentException( Resources. GetResourceString( "EventSource_InvalidEventFormat") , nameof ( settings) ) ;
3998
3998
}
3999
3999
4000
4000
// If you did not explicitly ask for manifest, you get self-describing.
@@ -4351,7 +4351,7 @@ public void EnableEvents(EventSource eventSource, EventLevel level, EventKeyword
4351
4351
{
4352
4352
if ( eventSource == null )
4353
4353
{
4354
- throw new ArgumentNullException( " eventSource" ) ;
4354
+ throw new ArgumentNullException( nameof ( eventSource) ) ;
4355
4355
}
4356
4356
Contract. EndContractBlock( ) ;
4357
4357
@@ -4366,7 +4366,7 @@ public void DisableEvents(EventSource eventSource)
4366
4366
{
4367
4367
if ( eventSource == null )
4368
4368
{
4369
- throw new ArgumentNullException( " eventSource" ) ;
4369
+ throw new ArgumentNullException( nameof ( eventSource) ) ;
4370
4370
}
4371
4371
Contract. EndContractBlock( ) ;
4372
4372
@@ -6000,7 +6000,7 @@ internal EventDispatcher(EventDispatcher next, bool[] eventEnabled, EventListene
6000
6000
internal bool m_activityFilteringEnabled; // does THIS EventSource have activity filtering turned on for this listener?
6001
6001
#endif // FEATURE_ACTIVITYSAMPLING
6002
6002
6003
- // Only guarenteed to exist after a InsureInit()
6003
+ // Only guaranteed to exist after a InsureInit()
6004
6004
internal EventDispatcher m_Next; // These form a linked list in code:EventSource.m_Dispatchers
6005
6005
// Of all listeners for that eventSource.
6006
6006
}
0 commit comments