SharePoint 2010: Using Event Receivers, Example 3: Tracking Document Sources
Event receivers in SharePoint Foundation 2010 enable your custom code to respond when specific actions occur on a SharePoint object. When a document in a document library is edited, a metadata property is updated. This example demonstrates property promotion demotion.