mirror of
https://github.com/LeCoupa/awesome-cheatsheets.git
synced 2026-01-29 06:38:02 -08:00
Merge 3e3d42023b into 2aee46f169
This commit is contained in:
@@ -398,3 +398,17 @@ CHEATSHEET C#
|
|||||||
KeyPress KeyPressEventHandler(object sender, KeyPressEventArgs e)
|
KeyPress KeyPressEventHandler(object sender, KeyPressEventArgs e)
|
||||||
|
|
||||||
|
|
||||||
|
16. Garbage Collection
|
||||||
|
|
||||||
|
16.1 Using statements
|
||||||
|
//A using statement encapsulates the lifetime of an IDisposable object and auto manages memory
|
||||||
|
|
||||||
|
using(SomeManagedClass smc){
|
||||||
|
|
||||||
|
//Scope of SomeManagedClass
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Garbage collection happens here and the CLR disposes the object
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user