Some tricks of C#

1: Automatically generate the constructor of the class: ctor+Tab key (twice)
eg: public MainWindow{}
insert image description here

2: Automatically generate the properties of the class: prop+Tab key (twice)
eg: public int MyProperty{get;set;}
insert image description here

3: Automatically generate class attributes + fields: propfull+Tab key (twice)
eg: private int myVar;
public int MyProperty
{ get{return myVar;} set{myVar=value;}


insert image description here

4: Automatically generate dependency properties: propdp+Tab key (twice)
insert image description here
5: Automatically create classes: Class+Tab key (twice)
insert image description here

6: Automatically generate indexer: indexer+Tab key (twice)
insert image description here
7: Some shortcut keys of VS
Ctrl+K+C Comment Ctrl+K
+U Uncomment Ctrl+K+D Quickly code
its code
Ctrl+J Smart prompt Ctrl+
Z Undo Ctrl+S Save Shift+Home Select all to the left Shift
+ end Select all to the right Ctrl + F Find Ctrl + H Replace F5 Debug program Shift + F5 Stop debug program F9 Set breakpoint F10 Execute the code line by line (do not enter the method) F11 execute the code line by line (enter the method) Ctrl +M+O to collapse all methods Ctrl+M+M to collapse or expand the current method Ctrl+M+L to expand all methods











Guess you like

Origin blog.csdn.net/m0_46454966/article/details/131873706