Skip to content

Latest commit

 

History

History
24 lines (22 loc) · 1.08 KB

File metadata and controls

24 lines (22 loc) · 1.08 KB
title How to: Use a Dictionary to Store Event Instances (C# Programming Guide)
ms.date 07/20/2015
ms.prod .net
ms.technology
devlang-csharp
ms.topic article
helpviewer_keywords
events [C#], storing instances in a Dictionary
ms.assetid 9512c64d-5aaf-40cd-b941-ca2a592f0064
caps.latest.revision 16
author BillWagner
ms.author wiwagn

How to: Use a Dictionary to Store Event Instances (C# Programming Guide)

One use for accessor-declarations is to expose many events without allocating a field for each event, but instead using a Dictionary to store the event instances. This is only useful if you have many events, but you expect most of the events will not be implemented.

Example

[!code-csharpcsProgGuideEvents#9]

See Also

C# Programming Guide
Events
Delegates