I need to implement this:
static class MyStaticClass
{
public const TimeSpan theTime = new TimeSpan(13, 0, 0);
public static bool IsTooLate(DateTime
You can use the readonly keyword:
When a field declaration includes a readonly modifier, assignments to the fields introduced by the declaration can only occur as part of the declaration or in a constructor in the same class.
Example (copied from the linked MSDN page):
class Age { readonly int _year; Age(int year) { _year = year; } void ChangeYear() { //_year = 1967; // Compile error if uncommented. } }