Friday, October 21, 2022

Updating XML documention: XML schema (XSD) validation with XmlSchemaSet

In my never-ending quest to keep Microsoft's documentation, I noted the following in XML schema (XSD) validation with XmlSchemaSet:

The code above subscribes to an event by creating a new delegate instance (new ValidationEventHandler) which was how code was written in for C# 1.0 to 1.1 (2002-2004):

  booksSettings.ValidationEventHandler +=
    new ValidationEventHandler(

As of C# 2.0 (released in 2005) there is no need to explicitly create a delegate instance when subscribing to an event:

  booksSettings.ValidationEventHandler +=

The updated code is as follows:

I created a fork in Microsoft's documentation (open source on and within twenty-four hours Microsoft accepted the change and merged the code:

No comments :

Post a Comment