All predefined templates are stored in the ReSharper installation. All necessary modifications, including deletion of predefined templates, are saved in settings layers.
Code templates are prewritten snippets of code provided by NetBeans IDE. You can paste a snippet into your code by using code completion or the template's abbreviation followed by the Tab key. You can also surround your code with appropriate PHP snippets. Finally, you can define your own code templates.
Press Ctrl+Alt+S to open the IDE settings and select Editor | Live Templates. Select the template group where you want to create a new live template (for example, other). If you do not select a template group, the live template will be added to the user group. and select Live Template.
Telerik® JustCode™ comes with a number of predefined templates to insert or surround existing code with common data structures and statements. To learn about code templates take a look at the Code Templates topic.
So simple, so useful - a little lambda:
Shortcut: x
Available: C# where expression is allowed.
x => x.$END$
Macros: none.
Implement Joe Duffy's Dispose Pattern
Shortcut: dispose
Available in: C# 2.0+ files where type member declaration is allowed
public void Dispose()
{
Dispose(true);
System.GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
if ($MEMBER$ != null)
{
$MEMBER$.Dispose();
$MEMBER$ = null;
}
}
disposed = true;
}
}
~$CLASS$()
{
Dispose(false);
}
private bool disposed;
Macros properties:
Shortcut: ntf
Available in: C# 2.0+ files where type member declaration or namespace declaration is allowed
[NUnit.Framework.TestFixtureAttribute]
public sealed class $TypeToTest$Tests
{
[NUnit.Framework.TestAttribute]
public void $Test$()
{
var t = new $TypeToTest$()
$END$
}
}
Macros:
If you're using .Net 4 you may prefer to use string.IsNullOrWhiteSpace().
Shortcut: sne
Available in: C# 2.0+ where expression is allowed.
string.IsNullOrEmpty($VAR$)
Macro properties:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With