Codesmith practical tips (15th): use shortcuts

Source: Internet
Author: User

InCodesmith, The following shortcut keys help us quickly enter.

1.CTRL + Shift + c

On the empty line, pressCTRL + Shift + cEnterCodeBlock.

<% %>

 2.CTRL + Shift + q

PressCTRL + Shift + qEnter a script block.

< Script runat = " Template " >

</ Script >

3.CTRL + Shift + V

Reverse the code block, such as the following code line:

<%   For ( Int I = 0 ; I < 10 ; I ++ ) {} %>

Press between two bracesCTRL + Shift + VThe Code is as follows:

<%   For ( Int I = 0 ; I < 10 ; I ++ ) {%><%} %>

4.CTRL + Shift + W

PressCTRL + Shift + WThen, an output code block is entered:

<% = %>

Note: when using the shortcut key, if you want to place a piece of code in the middle of the mark, select the code first, and then press the shortcut key combination. For example, if we have a piece of code like this, we want to put it in<SCRIPT>.

Public   Enum Collectiontypeenum

{

Vector,

 

Hashtable,

 

Sortedlist

}

Public   Override   Void Render (textwriter writer)

{

Streamwriter filewriter1 =   New Streamwriter ( @" C: \ test1.cs " , True );

This . Response. addtextwriter (filewriter1 );

 

Streamwriter filewriter2 =   New Streamwriter ( @" C: \ test2.cs " , True );

This . Response. addtextwriter (filewriter2 );

 

Base . Render (writer );

 

Filewriter1.close ();

Filewriter2.close ();

}

Select it, and then pressCTRL + Shift + qThen it will become:

< Script runat = " Template " >

Public   Enum Collectiontypeenum

{

Vector,

 

Hashtable,

 

Sortedlist

}

Public   Override   Void Render (textwriter writer)

{

Streamwriter filewriter1 =   New Streamwriter ( @" C: \ test1.cs " , True );

This . Response. addtextwriter (filewriter1 );

 

Streamwriter filewriter2 =   New Streamwriter ( @" C: \ test2.cs " , True );

This . Response. addtextwriter (filewriter2 );

 

Base . Render (writer );

 

Filewriter1.close ();

Filewriter2.close ();

}

</ Script >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.