Example:
using (BlackJackForm blackjackform = new BlackJackForm())
{
Hide();
blackjackform.ShowDialog();
Show();
}
The above is the equivalent of the following more verbose code:
BlackJackForm blackjackform = new BlackJackForm()
try {
Hide();
blackjackform.ShowDialog();
Show();
}
finally {
blackjackform.Dispose();
}
The using statement only works with items implementing the IDisposable interface.
1 comment:
The C# 'using' statement provides a convenient syntax that ensures the correct use of IDisposable objects.install mac on PC
Post a Comment