I wrote a class in C #.
I came across this part of the sentence offered by the code refactor. And I didnt
get what exactly this tool had in mind when offering this suggestion / improvement.
Situation:
I used the this.Text property to set the title in the constructor of my Form class.
Form() { //some initialization code ... //... this.Text = "Non modal form"; //Suggestion offered here.. }
Code refactoring tool requested a warning: talking about access to a virtual member
To fix this, the tool automatically added a property
public override sealed string Text { get { return base.Text; } set { base.Text = value; } }
Can someone explain to me how adding a sealed property will influence and improve the situation.
Greetings
source share