Is there a way to tell Visual Studio to make qualifying members of the current instance with this.
mandatory? I prefer the clarity.
Details:
In C#, if you have instance members (fields, properties, methods, etc.), normally you can refer to them both with and without this
, e.g.:
class Foo
{
private int bar;
Foo()
{
// These two lines are both valid, and both do exactly the same thing
bar = 42;
this.bar = 42;
}
}
In my coding style, I don't want this
to optional, I want the first line above to cause at least a warning. Obviously this is just for my own purposes, I'm not trying to mark the resulting assembly in some way that requires people using it to also do this, this is purely a personal style thing.