Skip to main content

C# Snippets for Visual Studio

List of Selected Snippets

ShortcutTitle
_evinterface event
_ininterface @type@ indexer
_minterface method
_pinterface @type@ property
_rpinterface read-only @type@ property
aattribute
acpublic abstract class
ampublic abstract method
appublic abstract auto property
arppublic abstract read-only auto property
bbraces
cpublic class
c_Attribute class
catchcatch clause
copublic constructor
copconditional operator
copnconditional operator (equal to null)
copxnconditional operator (not equal to null)
ddefault keyword
daDebug.Assert
depublic delegate
disposedispose pattern
dondo while null
doxndo while not null
dtDateTime type
dtoDateTimeOffset type
dwDebug.WriteLine
eelse clause
eifelse-if
enpublic enum
equalsEquals and GetHashCode
equalsEquals and GetHashCode for value type
evpublic event
fpublic field
feforeach statement
finallyfinally clause
frfor statement
frrfor statement (reversed)
ipublic interface
ifnif equal to null
iftgvif @type@ TryGetValue
iftpif @type@ TryParse
ifxif not
ifxnif not equal to null
ifxtgvif not @type@ TryGetValue
ifxtpif not @type@ TryParse
inpublic indexer
kpublic const
kvpKeyValuePair type
kvpcKeyValuePair.Create method
llambda expression
l0lambda expression without parameters
l2lambda expression with 2 parameters
mpublic method
nequal to null
nonameof operator
oobject keyword
oo== operator overloading
ppublic auto property
paparameter array @ofType@
ppif#if directive
ppife#if-#else directive
ppr#region directive
ppspublic auto property with private setter
rreturn keyword
republic record
refreturn false
renreturn null
restpublic record struct
retreturn true
rfpublic read-only field
rinpublic read-only indexer
rppublic read-only auto property
rrestpublic readonly record struct
rstpublic read-only struct
sstring keyword
scpublic static class
scostatic constructor
sfpublic static field
smpublic static method
snestring.IsNullOrEmpty
snwstring.IsNullOrWhiteSpace
srfpublic static read-only field
srppublic static read-only auto property
stpublic struct
swswitch statement
sweswitch expression
texplicit cast operator
tctry-catch
tcftry-catch-finally
tdTODO comment
tftry-finally
thiscontaining type name
thnthrow new
totypeof operator
uusing statement
ususing static directive
uvusing variable
vlocal variable declaration
vaarray variable
vbBoolean variable
viInt32 variable
vmpublic virtual method
vn- new variable
vppublic virtual auto property
vrppublic virtual read-only auto property
vsString variable
vtlocal variable declaration with explicit cast operator
wwhile statement
wheregeneric type constraint
wnwhile null
wxwhile not statement
wxnwhile not null
xnnot equal to null
xsne!string.IsNullOrEmpty
xsnw!string.IsNullOrWhiteSpace
ybyield break statement
yryield return statement