The installer receives value as its own "argument" based on the value you assign to the property:
foo.It = "xyz";
If you want to use an additional parameter, you need an index:
public string this[string key] { get { } set { } }
Then you will access it as
foo["key"] = "newValue";
You cannot specify index names in C # or use named indexes from other languages โโby name (except in the case of COM starting with C # 4).
EDIT: As Colin pointed out, you should use indexers carefully ... not just use them as a way to get an extra parameter only for the setter, which you then ignore in the getter, for example. Something like this would be terrible:
// Bad code! Do not use! private string fullName; public string this[string firstName] { get { return fullName; } set { fullName = firstName + " " + value; } } // Sample usage... foo["Jon"] = "Skeet"; string name = foo["Bar"]; // name is now "Jon Skeet"
source share