<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=C_Sharp_Events</id>
	<title>C Sharp Events - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=C_Sharp_Events"/>
	<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=C_Sharp_Events&amp;action=history"/>
	<updated>2026-10-06T10:07:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=C_Sharp_Events&amp;diff=828&amp;oldid=prev</id>
		<title>10.1.1.3: Created page with &quot; An event in C# contains two components: # An event handler # The actual event  The event handler is a delegate which defines what arguments the event will contain. You can al...&quot;</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=C_Sharp_Events&amp;diff=828&amp;oldid=prev"/>
		<updated>2014-11-01T23:27:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; An event in C# contains two components: # An event handler # The actual event  The event handler is a delegate which defines what arguments the event will contain. You can al...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
An event in C# contains two components:&lt;br /&gt;
# An event handler&lt;br /&gt;
# The actual event&lt;br /&gt;
&lt;br /&gt;
The event handler is a delegate which defines what arguments the event will contain. You can always use the EventHandler base class with the &amp;#039;sender&amp;#039; and &amp;#039;EventArgs&amp;#039; arguments.&lt;br /&gt;
&lt;br /&gt;
The actual event will use the event handler with a given name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
private delegate void StationChangedEventHandler();&lt;br /&gt;
private event StationChangedEventHandler StationChanged;&lt;br /&gt;
&lt;br /&gt;
protected virtual void OnStationChanged() {&lt;br /&gt;
	StationChangedEventHandler handler = this.OnStationChanged;&lt;br /&gt;
	if (handler != null)&lt;br /&gt;
		handler();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:C-Sharp]]&lt;/div&gt;</summary>
		<author><name>10.1.1.3</name></author>
	</entry>
</feed>