From 6ce2a7537a407fbf17743dd8b4eabd933a59cc9a Mon Sep 17 00:00:00 2001 From: metu Date: Wed, 27 Mar 2019 07:11:50 +0200 Subject: [PATCH] Added example for event handler parameter names Added event handler method with 'sender' and 'e' parameter names for point number 24: "DO use two parameters named sender and e in event handlers." --- C# Coding Standards and Naming Conventions.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/C# Coding Standards and Naming Conventions.md b/C# Coding Standards and Naming Conventions.md index 0f91076..11d88fb 100644 --- a/C# Coding Standards and Naming Conventions.md +++ b/C# Coding Standards and Naming Conventions.md @@ -392,6 +392,13 @@ private void MyFunction(string name, string Name) #### 24. DO use two parameters named sender and e in event handlers. The sender parameter represents the object that raised the event. The sender parameter is typically of type object, even if it is possible to employ a more specific type. +```csharp +public void ReadBarcodeEventHandler(object sender, ReadBarcodeEventArgs e) +{ + //... +} +``` + ***Why: consistent with the Microsoft's .NET Framework*** ***Why: consistent with the Microsoft's .NET Framework and consistent with prior rule of no type indicators in identifiers.***