How can we generate getters and setters in Visual Studio?

后端 未结 16 2227
盖世英雄少女心
盖世英雄少女心 2020-12-07 07:46

By \"generate\", I mean auto-generation of the code necessary for a particular selected (set of) variable(s).

But any more explicit explication or comment on good pr

16条回答
  •  旧巷少年郎
    2020-12-07 07:57

    I created my own snippet that only adds {get; set;}. I made it just because I find propTab to be clunky.

    
    
        
            
    get set get

    With this, you type your PropType and PropName manually, then type getTab, and it will add the get set. It's nothing magical, but since I tend to type my access modifier first anyway, I may as well finish out the name and type.

提交回复
热议问题