Does C# allow a variable that can\'t be modified? It\'s like a const, but instead of having to assign it a value at declaration, the variable does not have any
If you want to assign the variable at runtime after the object containing it has been constructed you could use a custom property with a setter method that can only be modified once. ie.
private myVariable = null;
public object MyVariable
{
get { return myVariable; }
set { if(myVariable == null ) myVariable = value;
}