Repository navigation
EN CSharp Complete Reference
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Self-contained examples describe common C# 14: individual .cs programs with Main or top-level code, multi-file .csproj and specially marked .csx. Each program is launched separately. Console.WriteLine writes to the console; for game log use context.UO.Print(...) in ICSharpScript or UO.Print(...) in .csx.
Practical Guide · Program Structure · Groups UO
Save this example separately as Example.cs. Run it independently of the other examples on this page.
Example.cs:
// PROJECT-EXAMPLE
int count = 2;
count += 3;
System.Console.WriteLine(count);Result:
5
| Construction | Explanations and full examples | Status |
|---|---|---|
abstract |
C#: abstract |
C# 14 |
as |
C#: as |
C# 14 |
base |
C#: base |
C# 14 |
bool |
C#: bool |
C# 14 |
break |
C#: break |
C# 14 |
byte |
C#: byte |
C# 14 |
case |
C#: case |
C# 14 |
catch |
C#: catch |
C# 14 |
char |
C#: char |
C# 14 |
checked |
C#: checked |
C# 14 |
class |
C#: class |
C# 14 |
const |
C#: const |
C# 14 |
continue |
C#: continue |
C# 14 |
decimal |
C#: decimal |
C# 14 |
default |
C#: default |
C# 14 |
delegate |
C#: delegate |
C# 14 |
do |
C#: do |
C# 14 |
double |
C#: double |
C# 14 |
else |
C#: else |
C# 14 |
enum |
C#: enum |
C# 14 |
event |
C#: event |
C# 14 |
explicit |
C#: explicit |
C# 14 |
extern |
C#: extern |
C# 14 |
false |
C#: false |
C# 14 |
finally |
C#: finally |
C# 14 |
fixed |
C#: fixed |
C# 14 |
float |
C#: float |
C# 14 |
for |
C#: for |
C# 14 |
foreach |
C#: foreach |
C# 14 |
goto |
C#: goto |
C# 14 |
if |
C#: if |
C# 14 |
implicit |
C#: implicit |
C# 14 |
in |
C#: in |
C# 14 |
int |
C#: int |
C# 14 |
interface |
C#: interface |
C# 14 |
internal |
C#: internal |
C# 14 |
is |
C#: is |
C# 14 |
lock |
C#: lock |
C# 14 |
long |
C#: long |
C# 14 |
namespace |
C#: namespace |
C# 14 |
new |
C#: new |
C# 14 |
null |
C#: null |
C# 14 |
object |
C#: object |
C# 14 |
operator |
C#: operator |
C# 14 |
out |
C#: out |
C# 14 |
override |
C#: override |
C# 14 |
params |
C#: params |
C# 14 |
private |
C#: private |
C# 14 |
protected |
C#: protected |
C# 14 |
public |
C#: public |
C# 14 |
readonly |
C#: readonly |
C# 14 |
ref |
C#: ref |
C# 14 |
return |
C#: return |
C# 14 |
sbyte |
C#: sbyte |
C# 14 |
sealed |
C#: sealed |
C# 14 |
short |
C#: short |
C# 14 |
sizeof |
C#: sizeof |
C# 14 |
stackalloc |
C#: stackalloc |
C# 14 |
static |
C#: static |
C# 14 |
string |
C#: string |
C# 14 |
struct |
C#: struct |
C# 14 |
switch |
C#: switch |
C# 14 |
this |
C#: this |
C# 14 |
throw |
C#: throw |
C# 14 |
true |
C#: true |
C# 14 |
try |
C#: try |
C# 14 |
typeof |
C#: typeof |
C# 14 |
uint |
C#: uint |
C# 14 |
ulong |
C#: ulong |
C# 14 |
unchecked |
C#: unchecked |
C# 14 |
unsafe |
C#: unsafe |
C# 14 |
ushort |
C#: ushort |
C# 14 |
using |
C#: using |
C# 14 |
virtual |
C#: virtual |
C# 14 |
void |
C#: void |
C# 14 |
volatile |
C#: volatile |
C# 14 |
while |
C#: while |
C# 14 |
add |
C#: add |
C# 14 |
allows |
C#: allows |
C# 14 |
alias |
C#: alias |
C# 14 |
and |
C#: and |
C# 14 |
ascending |
C#: ascending |
C# 14 |
args |
C#: args |
C# 14 |
async |
C#: async |
C# 14 |
await |
C#: await |
C# 14 |
by |
C#: by |
C# 14 |
closed |
C#: closed |
preview C# 15 |
descending |
C#: descending |
C# 14 |
dynamic |
C#: dynamic |
C# 14 |
equals |
C#: equals |
C# 14 |
extension |
C#: extension |
C# 14 |
field |
C#: field |
C# 14 |
file |
C#: file |
C# 14 |
from |
C#: from |
C# 14 |
get |
C#: get |
C# 14 |
global |
C#: global |
C# 14 |
group |
C#: group |
C# 14 |
init |
C#: init |
C# 14 |
into |
C#: into |
C# 14 |
join |
C#: join |
C# 14 |
let |
C#: let |
C# 14 |
managed (function pointer calling convention) |
C#: managed — function pointer call convention |
C# 14 |
nameof |
C#: nameof |
C# 14 |
nint |
C#: nint |
C# 14 |
not |
C#: not |
C# 14 |
notnull |
C#: notnull |
C# 14 |
nuint |
C#: nuint |
C# 14 |
on |
C#: on |
C# 14 |
or |
C#: or |
C# 14 |
orderby |
C#: orderby |
C# 14 |
partial (type) |
C#: partial is partial type |
C# 14 |
partial (member) |
C#: partial is a partial term |
C# 14 |
record |
C#: record |
C# 14 |
remove |
C#: remove |
C# 14 |
required |
C#: required |
C# 14 |
safe |
C#: safe |
preview C# 15 |
scoped |
C#: scoped |
C# 14 |
select |
C#: select |
C# 14 |
set |
C#: set |
C# 14 |
unmanaged (function pointer calling convention) |
C#: unmanaged — function pointer call convention |
C# 14 |
unmanaged (generic type constraint) |
C#: unmanaged is a type parameter constraint |
C# 14 |
value |
C#: value |
C# 14 |
var |
C#: var |
C# 14 |
when (filter condition) |
C#: when — filter condition |
C# 14 |
where (generic type constraint) |
C#: where is a type parameter constraint |
C# 14 |
where (query clause) |
C#: where — LINQ clause |
C# 14 |
with |
C#: with |
C# 14 |
yield |
C#: yield |
C# 14 |
- Arithmetic
- Increment and Decrement
- Comparison
- Equality
- Logical operations
- Bits and Shifts
- Assignment
- Value at null
- Conditional Expression
- Members, Calling and Indexing
- Suppress nullable-warning
- End Indices and Ranges
- Collections and spread
- Lambda expressions and body expressions
- Explicit conversion
- nickname qualifier
- Operations with pointers
- String forms
- Assignment via null-conditional
- Conditional compilation
- Compile Symbols
- Nullable-context
- Code Collapse
- Compiler Message
- Explicit compilation error
- Diagnostics Management
- Display of original positions
- Connecting .csx sources
- Connect assembly to .csx
C#-syntax and .NET libraries are different levels: for additional libraries, dependencies are declared in .csproj. Preview pages are included for the completeness of the current official catalog and clearly indicate the requirements for the future platform.
Official catalog: keywords Microsoft and operators Microsoft.
ClassicUO — Bad Newbie & C# Scripts IDE