Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal static class Program
- {
- public struct MyStruct : IDisposable
- {
- public bool IsDisposed { get; private set; }
- public void Dispose()
- {
- IsDisposed = true;
- }
- }
- private static void Main(string[] args)
- {
- var s = new MyStruct();
- using (s)
- {
- Console.WriteLine(s.IsDisposed);
- }
- Console.WriteLine(s.IsDisposed);
- }
- }
Add Comment
Please, Sign In to add comment