---
source: https://iinventedlight.com/library/notes/csharp-delegates-events.md
title: "C# delegates and events"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (dotnet/docs); prose restates cited source lines"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn (.NET docs), Work with delegate types in C# - C#, CC BY 4.0 (dotnet/docs); Microsoft Learn (.NET docs), Events - C#, CC BY 4.0 (dotnet/docs)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: C#"
tags: ['csharp', 'dotnet', 'delegates', 'events']
sources:
  - id: S1
    title: "Work with delegate types in C# - C#"
    publisher: Microsoft Learn (.NET docs)
    url: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/
    accessed: 2026-11-04
    license: "CC BY 4.0 (dotnet/docs)"
  - id: S2
    title: "Events - C#"
    publisher: Microsoft Learn (.NET docs)
    url: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/
    accessed: 2026-11-04
    license: "CC BY 4.0 (dotnet/docs)"
---
# C# delegates and events

**Answer:** A delegate is a type-safe reference to a method, which lets you pass methods as parameters and chain several together.

## Delegates

```csharp
Func<int, int> square = x => x * x;
Action<string> log = Console.WriteLine;
log += s => Debug.WriteLine(s);   // multicast chain
log("hello");                       // calls both
```


## Events

```csharp
class Downloader {
  public event EventHandler<int>? Progress;
  void Report(int pct) => Progress?.Invoke(this, pct);
}

var d = new Downloader();
d.Progress += (s, pct) => Console.WriteLine($"{pct}%");
```

In .NET, events conventionally use `EventHandler` or `EventHandler<T>` with `EventArgs`.

## Notes

- An event can have many subscribers, and a subscriber can handle many events.

## Claims
- id: C1
  claim: Delegates allow methods to be passed as parameters.
  source: S1
  evidence: "Delegates allow methods to be passed as parameters."
- id: C2
  claim: Delegates can be chained together.
  source: S1
  evidence: "Delegates can be chained together, such as calling multiple methods on a single event."
- id: C3
  claim: The publisher decides when an event is raised; subscribers decide the response.
  source: S2
  evidence: "The publisher determines when an event is raised; the subscribers determine what action is taken"
- id: C4
  claim: An event can have multiple subscribers.
  source: S2
  evidence: "An event can have multiple subscribers."
- id: C5
  claim: .NET events are based on EventHandler and EventArgs.
  source: S2
  evidence: "events are based on the EventHandler delegate and the EventArgs base class."

## Sources
- [S1] Work with delegate types in C# - C#. Microsoft Learn (.NET docs). https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/delegates/ . License: CC BY 4.0 (dotnet/docs). Accessed 2026-11-04.
- [S2] Events - C#. Microsoft Learn (.NET docs). https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/ . License: CC BY 4.0 (dotnet/docs). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
