privateint objectId;
publicint ObjectId {
get { return objectId; }
internal set { objectId = value; }
}
Provided the additional access modifier on the get or the set is weaker than the overall access modifier, this is fine.
It would be nice if the Generate Read-Write Property popup allowed the user to specify the access modifier they want for both the get AND the set, and then ReSharper worked out which one should go where.
Description
In .NET v2 it is legal to do this:
privateint objectId;
publicint ObjectId {
get { return objectId; }
internal set { objectId = value; }
}
Provided the additional access modifier on the get or the set is weaker than the overall access modifier, this is fine.
It would be nice if the Generate Read-Write Property popup allowed the user to specify the access modifier they want for both the get AND the set, and then ReSharper worked out which one should go where.
Re: #14122- Generate Read-Write property accessibility
I think there are a lot of people out there that don't yet realise this syntax is legal.
As long as the implementation of such a feature doesn't change the expected/default behavior of "Generate Read-Write property" (i.e. simply pressing "OK" will generate the property with the same accessibility for get and set), then I think it would be very useful.
Gerrod Thomas - 08 Aug 06 15:09 Re: #14122- Generate Read-Write property accessibility
I think there are a lot of people out there that don't yet realise this syntax is legal.
As long as the implementation of such a feature doesn't change the expected/default behavior of "Generate Read-Write property" (i.e. simply pressing "OK" will generate the property with the same accessibility for get and set), then I think it would be very useful.
I think there are a lot of people out there that don't yet realise this syntax is legal.
As long as the implementation of such a feature doesn't change the expected/default behavior of "Generate Read-Write property" (i.e. simply pressing "OK" will generate the property with the same accessibility for get and set), then I think it would be very useful.