Guest User

Untitled

a guest
Dec 12th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. internal static class Program
  2. {
  3. public struct MyStruct : IDisposable
  4. {
  5. public bool IsDisposed { get; private set; }
  6.  
  7. public void Dispose()
  8. {
  9. IsDisposed = true;
  10. }
  11. }
  12.  
  13. private static void Main(string[] args)
  14. {
  15. var s = new MyStruct();
  16. using (s)
  17. {
  18. Console.WriteLine(s.IsDisposed);
  19. }
  20.  
  21. Console.WriteLine(s.IsDisposed);
  22. }
  23. }
Add Comment
Please, Sign In to add comment