ReSharper 8.0 Web Help

ReSharper | Templates Explorer | File Templates

This topic lists all predefined File templates in ReSharper 8.0.

File templates are used to create one or more new files with predefined code, such as a class or interface declaration, unit test, ASP.NET page with code behind file, etc. File templates have no shortcuts, they are identified by their descriptions. See Creating Files from Templates and Creating and Editing Multi-File Templates for details.

Template Description

C#

Class Create a new file in the current project containing an empty C# Class.
Interface Create a new file in the current project containing an empty C# Interface.
Struct Create a new file in the current project containing an empty C# Struct.
Enum Create a new file in the current project containing an empty C# Enum.

VB.NET

Class Create a new file in the current project containing an empty VB.NET Class.
Interface Create a new file in the current project containing an empty VB.NET Interface.
Structure Create a new file in the current project containing an empty VB.NET Structure.
Module Create a new file in the current project containing an empty VB.NET Module.
Enum Create a new file in the current project containing an empty VB.NET Enum.

ASP.NET (C#)

MVC View Page with master page MVC View Page with master page
MVC View Page without master page MVC View Page without master page
MVC View UserControl MVC View UserControl
Web form without master page Web form without master page
Web form with master page Web form with master page
Master page without base master page Master page without base master page
Master page with base master page Master page with base master page
Web control Web control

ASP.NET (VB)

MVC View Page with master page MVC View Page with master page
MVC View Page without master page MVC View Page without master page
MVC View UserControl MVC View UserControl
Web form without master page Web form without master page
Web form with master page Web form with master page
Master page without base master page Master page without base master page
Master page with base master page Master page with base master page
Web control Web control

Razor (C#)

Razor MVC Partial View Razor MVC Partial View
Razor MVC View Razor MVC View
Razor MVC View with Layout Razor MVC View with Layout

XAML

Resource Dictionary Resource Dictionary

C#

Template Details
Class

Create a new file in the current project containing an empty C# Class.

Scope C# projects

Body

$HEADER$namespace $NAMESPACE$
{
  public class $CLASS$ {$END$}
}

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options.
  • CLASS - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.
Interface

Create a new file in the current project containing an empty C# Interface.

Scope C# projects

Body

$HEADER$namespace $NAMESPACE$
{
  public interface $INTERFACE$ {$END$}
}

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options.
  • INTERFACE - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.
Struct

Create a new file in the current project containing an empty C# Struct.

Scope C# projects

Body

$HEADER$namespace $NAMESPACE$
{
  public struct $STRUCT$ {$END$}
}

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options.
  • STRUCT - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.
Enum

Create a new file in the current project containing an empty C# Enum.

Scope C# projects

Body

$HEADER$namespace $NAMESPACE$
{
  public enum $ENUM$ {$END$}
}

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options.
  • ENUM - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.

VB.NET

Template Details
Class

Create a new file in the current project containing an empty VB.NET Class.

Scope VB.NET projects

Body

Public Class $CLASS$
  $END$
End Class

Parameters

  • CLASS - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.
Interface

Create a new file in the current project containing an empty VB.NET Interface.

Scope VB.NET projects

Body

Public Interface $INTERFACE$
  $END$
End Interface

Parameters

  • INTERFACE - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.
Structure

Create a new file in the current project containing an empty VB.NET Structure.

Scope VB.NET projects

Body

Public Structure $STRUCTURE$
  $END$
End Structure

Parameters

  • STRUCTURE - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.
Module

Create a new file in the current project containing an empty VB.NET Module.

Scope VB.NET projects

Body

Public Module $MODULE$
  $END$
End Module

Parameters

  • MODULE - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.
Enum

Create a new file in the current project containing an empty VB.NET Enum.

Scope VB.NET projects

Body

Public Enum $ENUM$
  $END$
End Enum

Parameters

  • ENUM - Evaluates current file name without extension
  • NAMESPACE - Gets default namespace for the current file
  • END - The caret position after the template is applied.

ASP.NET (C#)

Template Details
MVC View Page with master page

MVC View Page with master page

Scope ASP.NET (C#) projects

Body

<%@ Page Title="$Title$" Language="C#" Inherits="System.Web.Mvc.ViewPage<$ModelType$>" MasterPageFile="$MasterPage$" %>

$CONTENT$

Parameters

  • Title - no macro
  • ModelType - Guess type expected at this point
  • MasterPage - Show smart code completion list at the point where the variable is evaluated
  • CONTENT - Generate content for masterpage content placeholders at the point where the variable is evaluated
MVC View Page without master page

MVC View Page without master page

Scope ASP.NET (C#) projects

Body

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<$ModelType$>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>$Title$</title>
</head>
<body>
    $END$
</body>
</html>

Parameters

  • ModelType - Guess type expected at this point
  • Title - no macro
  • END - The caret position after the template is applied.
MVC View UserControl

MVC View UserControl

Scope ASP.NET (C#) projects

Body

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<$ModelType$>" %>

$END$

Parameters

  • ModelType - Guess type expected at this point
  • END - The caret position after the template is applied.
Web form without master page

Web form without master page

Scope ASP.NET (C#) projects

Body

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>$Title$</title>
</head>
<body>
    <form id="$form1$" runat="server">
    <div>
    $END$
    </div>
    </form>
</body>
</html>

Parameters

  • Title - no macro
  • form1 - When exectuted in variable declaration (where variable name should stand), suggests name for the variable.
  • END - The caret position after the template is applied.
Web form with master page

Web form with master page

Scope ASP.NET (C#) projects

Body

<%@ Page Title="$Title$" Language="C#" MasterPageFile="$MasterPage$" %>

$CONTENT$

Parameters

  • Title - no macro
  • MasterPage - Show smart code completion list at the point where the variable is evaluated
  • CONTENT - Generate content for masterpage content placeholders at the point where the variable is evaluated
Master page without base master page

Master page without base master page

Scope ASP.NET (C#) projects

Body

<%@ Master Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="$head$" runat="server">
    $END$</asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder id="$ContentPlaceHolder1$" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

Parameters

  • head - When exectuted in variable declaration (where variable name should stand), suggests name for the variable.
  • ContentPlaceHolder1 - When exectuted in variable declaration (where variable name should stand), suggests name for the variable.
  • END - The caret position after the template is applied.
Master page with base master page

Master page with base master page

Scope ASP.NET (C#) projects

Body

<%@ Master Language="C#" MasterPageFile="$MasterPage$" %>

$CONTENT$

Parameters

  • MasterPage - Show smart code completion list at the point where the variable is evaluated
  • CONTENT - Generate content for masterpage content placeholders at the point where the variable is evaluated
Web control

Web control

Scope ASP.NET (C#) projects

Body

<%@ Control Language="C#" ClassName="$ClassName$" %>

$END$

Parameters

  • ClassName - Evaluates current file name without extension
  • END - The caret position after the template is applied.

ASP.NET (VB)

Template Details
MVC View Page with master page

MVC View Page with master page

Scope ASP.NET (VB) projects

Body

<%@ Page Title="$Title$" Language="VB" Inherits="System.Web.Mvc.ViewPage(Of $ModelType$)" MasterPageFile="$MasterPage$" %>

$CONTENT$

Parameters

  • Title - no macro
  • ModelType - Guess type expected at this point
  • MasterPage - Show smart code completion list at the point where the variable is evaluated
  • CONTENT - Generate content for masterpage content placeholders at the point where the variable is evaluated
MVC View Page without master page

MVC View Page without master page

Scope ASP.NET (VB) projects

Body

<%@ Page Language="VB" Inherits="System.Web.Mvc.ViewPage(Of $ModelType$)" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>$Title$</title>
</head>
<body>
    $END$
</body>
</html>

Parameters

  • ModelType - Guess type expected at this point
  • Title - no macro
  • END - The caret position after the template is applied.
MVC View UserControl

MVC View UserControl

Scope ASP.NET (VB) projects

Body

<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of $ModelType$)" %>

$END$

Parameters

  • ModelType - Guess type expected at this point
  • END - The caret position after the template is applied.
Web form without master page

Web form without master page

Scope ASP.NET (VB) projects

Body

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>$Title$</title>
</head>
<body>
    <form id="$form1$" runat="server">
    <div>
    $END$
    </div>
    </form>
</body>
</html>

Parameters

  • Title - no macro
  • form1 - When exectuted in variable declaration (where variable name should stand), suggests name for the variable.
  • END - The caret position after the template is applied.
Web form with master page

Web form with master page

Scope ASP.NET (VB) projects

Body

<%@ Page Title="$Title$" Language="VB" MasterPageFile="$MasterPage$" %>

$CONTENT$

Parameters

  • Title - no macro
  • MasterPage - Show smart code completion list at the point where the variable is evaluated
  • CONTENT - Generate content for masterpage content placeholders at the point where the variable is evaluated
Master page without base master page

Master page without base master page

Scope ASP.NET (VB) projects

Body

<%@ Master Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="$head$" runat="server">
    $END$</asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder id="$ContentPlaceHolder1$" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

Parameters

  • head - When exectuted in variable declaration (where variable name should stand), suggests name for the variable.
  • ContentPlaceHolder1 - When exectuted in variable declaration (where variable name should stand), suggests name for the variable.
  • END - The caret position after the template is applied.
Master page with base master page

Master page with base master page

Scope ASP.NET (VB) projects

Body

<%@ Master Language="VB" MasterPageFile="$MasterPage$" %>

$CONTENT$

Parameters

  • MasterPage - Show smart code completion list at the point where the variable is evaluated
  • CONTENT - Generate content for masterpage content placeholders at the point where the variable is evaluated
Web control

Web control

Scope ASP.NET (VB) projects

Body

<%@ Control Language="VB" ClassName="$ClassName$" %>

$END$

Parameters

  • ClassName - Evaluates current file name without extension
  • END - The caret position after the template is applied.

Razor (C#)

Template Details
Razor MVC Partial View

Razor MVC Partial View

Scope Razor (C#) projects

Body

@model $model$

$END$

Parameters

  • model - Guess type expected at this point
  • END - The caret position after the template is applied.
Razor MVC View

Razor MVC View

Scope Razor (C#) projects

Body

@model $model$

@{
  Layout = null;
}

<!DOCTYPE html>

<html>
<head>
  <title>$title$</title>
</head>
<body>
  <div>
    $END$  
  </div>
</body>
</html>

Parameters

  • model - Guess type expected at this point
  • title - no macro
  • END - The caret position after the template is applied.
Razor MVC View with Layout

Razor MVC View with Layout

Scope Razor (C#) projects

Body

@model $model$

@{
  ViewBag.Title = "$title$";
  Layout = "$_Layout$";
}

<h2>$title$</h2>
$END$

Parameters

  • model - Guess type expected at this point
  • title - no macro
  • _Layout - Show smart code completion list at the point where the variable is evaluated
  • END - The caret position after the template is applied.

XAML

Template Details
Resource Dictionary

Resource Dictionary

Scope any XAML projects

Body

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  $END$
</ResourceDictionary>

Parameters

  • END - The caret position after the template is applied.