예제 #1
0
        static void Main(string[] args)
        {
            using (var wrapper = new ResourceWrapper())
            {
                Console.WriteLine(wrapper);
            }
            Console.WriteLine(new string('-', 20));

            var wrapper2 = new ResourceWrapper();
            Console.WriteLine(wrapper2);
            wrapper2.Dispose();
            wrapper2.Dispose();
            wrapper2.Dispose();
            wrapper2.Dispose();

            var wrapper3 = new ResourceWrapper();
            Console.ReadKey();
            Console.WriteLine("Press any key to dispose. ");
        }
예제 #2
0
        static void Main()
        {
            using (var wrapper = new ResourceWrapper())
            {
                Console.WriteLine(wrapper);
            }
            Console.WriteLine(new string('-', 20));


            var wrapper2 = new ResourceWrapper();

            Console.WriteLine(wrapper2);

            wrapper2.Dispose();
            wrapper2.Dispose();
            wrapper2.Dispose();
            wrapper2.Dispose();

            var wrapper3 = new ResourceWrapper();

            Console.ReadKey();
            Console.WriteLine("Press any key to dispose");
        }