How can we generate getters and setters in Visual Studio?

后端 未结 16 2240
盖世英雄少女心
盖世英雄少女心 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 08:06

    Use the propfull keyword.

    It will generate a property and a variable.

    Type keyword propfull in the editor, followed by two TABs. It will generate code like:

    private data_type var_name;
    
    public data_type var_name1{ get;set;}
    

    Video demonstrating the use of snippet 'propfull' (among other things), at 4 min 11 secs.

提交回复
热议问题