Quick Reference for C# and VB
- Default accessibility is
public
(Public
in Visual Basic)
Type/Member Declaration
Shortcut | Description | Comment |
---|---|---|
_ | interface member declaration | prefix |
c | class declaration | |
co | constructor declaration | |
de | delegate declaration | |
en | enum declaration | |
ev | event declaration | |
f | field declaration | |
i | interface declaration | |
in | indexer declaration | |
k | constant declaration | |
m | method declaration | |
mo | Module declaration | |
p | property declaration | |
re | record declaration | |
st | struct declaration |
Modifier
Shortcut | Description | Comment |
---|---|---|
a | abstract (MustInherit) | prefix (after access modifier) |
d | protected (Protected) | prefix |
i | internal (Friend) | prefix |
p | private | prefix |
r | read-only | prefix (after access modifier) |
s | static (Shared) | prefix (after access modifier) |
v | virtual (Overridable) | prefix (after access modifier) |
Statement
Shortcut | Description | Comment |
---|---|---|
fe | foreach statement | |
fr | for statement | |
if | if statement | |
sc | Select Case statement | |
sw | switch statement | |
t | try statement | |
th | throw statement | |
u | using statement | |
w | while statement |
Operator
Shortcut | Description | Comment |
---|---|---|
cop | conditional operator | |
gt | GetType operator | |
n | new object creation | |
no | nameof operator | |
oo | operator overload | |
t | explicit cast operator | |
tc | TryCast operator | |
to | typeof operator | |
x | logical not operator | prefix |
Type
Shortcut | Description | Comment |
---|---|---|
a | Array | |
b | Boolean | |
c | Collection<T> | |
d | Dictionary<TKey,TValue> | |
dt | DateTime | |
hs | HashSet<T> | |
i | Immutable | prefix |
i | Int32 | |
l | List<T> | |
ll | LinkedList<T> | |
o | Object | |
oc | ObservableCollection<T> | |
q | Queue<T> | |
s | Stack<T> | |
s | String |
Other
Shortcut | Description | Comment |
---|---|---|
c | catch clause | |
d | default keyword | |
e | else clause | |
f | finally clause | |
l | lambda expression | |
n | (equals to) null | |
pa | parameter array | |
pp | preprocessor directive | prefix |
ps | private set | |
r | return keyword | |
this | containing type name | |
v | local variable declaration | |
x | with initializer | suffix |
y | yield | prefix |