ReSharper 2018.2 Help

Predefined File Templates for C#

ReSharper | Templates Explorer | File Templates | C#

This topic lists all predefined file templates for C# in ReSharper 2018.2. For more information about file templates, see Creating Files from Templates

Template

Details

Class

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

Scope C# projects

Body

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

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options. (fileheader)

  • CLASS - Evaluates current file name without extension with all non-alphanumeric replaced with underscores (getAlphaNumericFileNameWithoutExtension)

  • NAMESPACE - Gets default namespace for the current file (fileDefaultNamespace)

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

Interface

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

Scope C# projects

Body

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

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options. (fileheader)

  • INTERFACE - Evaluates current file name without extension with all non-alphanumeric replaced with underscores (getAlphaNumericFileNameWithoutExtension)

  • NAMESPACE - Gets default namespace for the current file (fileDefaultNamespace)

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

Struct

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

Scope C# projects

Body

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

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options. (fileheader)

  • STRUCT - Evaluates current file name without extension with all non-alphanumeric replaced with underscores (getAlphaNumericFileNameWithoutExtension)

  • NAMESPACE - Gets default namespace for the current file (fileDefaultNamespace)

  • 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. (fileheader)

  • ENUM - Evaluates current file name without extension with all non-alphanumeric replaced with underscores (getAlphaNumericFileNameWithoutExtension)

  • NAMESPACE - Gets default namespace for the current file (fileDefaultNamespace)

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

Test Fixture

Test Fixture

Scope C# projects, References nunit.framework

Body

$HEADER$using NUnit.Framework; namespace $NAMESPACE$ { [TestFixture] public class $CLASS$ {$END$} }

Parameters

  • HEADER - Inserts the file header specified in the ReSharper options. (fileheader)

  • CLASS - Evaluates current file name without extension with all non-alphanumeric replaced with underscores (getAlphaNumericFileNameWithoutExtension)

  • NAMESPACE - Gets default namespace for the current file (fileDefaultNamespace)

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

Last modified: 21 December 2018