set (C# Reference)
The set keyword defines an accessor method in a property or indexer that assigns the value of the property or the indexer element. For more information, see Properties (C# Programming Guide), Auto-Implemented Properties (C# Programming Guide), and Indexers (C# Programming Guide).
This is an example of a set accessor for a property named Seconds:
This is an example of a set accessor in an auto-implemented property:
For more information, see the following sections in the C# Language Specification: