예제 #1
0
    public static void TestClass()
    {
        Console.WriteLine("creating wrapper...");
        MyResourceWrapper wrapper = new MyResourceWrapper();

        Console.WriteLine("using wrapper...");
    }
        //~Program()
        //{
        //    object
        //    Console.WriteLine(" prOGRAM CLASS Finalizer ");
        //}
        static void Main(string[] args)
        {
            MyResourceWrapper rw = new MyResourceWrapper();

            //Console.WriteLine("***** Fun with Finalizers *****\n");
            //Console.WriteLine("Hit the return key to shut down this app");
            //Console.WriteLine("and force the GC to invoke Finalize()");
            //Console.WriteLine("for finalizable objects created in this AppDomain.");

            ////MyResourceWrapper rw2 = new MyResourceWrapper();

            ////Program program = new Program();
            ///

            using (Student stu = new Student())
            {
                // logic , data
            }

            Student stu2 = new Student();

            //stu.Dispose();

            Console.ReadLine();
        }
예제 #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("*** Fun With Finalizers ****");
            Console.WriteLine("Hit enter to initiate finalize() method");

            Console.ReadLine();
            MyResourceWrapper rw = new MyResourceWrapper();
        }
예제 #4
0
 static void Main(string[] args)
 {
     Console.WriteLine("***** Fun with Finalizers *****\n");
     Console.WriteLine("Hit the return key to shut down this app");
     Console.WriteLine("and force the GC to invoke Finalize()");
     Console.WriteLine("for finalizable objects created in this AppDomain.");
     Console.ReadLine();
     MyResourceWrapper rw = new MyResourceWrapper();
 }
예제 #5
0
파일: Program.cs 프로젝트: usedflax/flaxbox
 static void Main( string[] args )
 {
     Console.WriteLine("***** Fun with Finalizers *****\n");
     Console.WriteLine("Hit the return key to shut down this app");
     Console.WriteLine("and force the GC to invoke Finalize()");
     Console.WriteLine("for finalizable objects created in this AppDomain.");
     Console.ReadLine();
     MyResourceWrapper rw = new MyResourceWrapper();
 }
예제 #6
0
파일: Program.cs 프로젝트: dakazia/apress
        private static void CreateObjects(int count)
        {
            MyResourceWrapper[] tonsOfObjects = new MyResourceWrapper[count];
            for (int i = 0; i < count; i++)
            {
                tonsOfObjects[i] = new MyResourceWrapper();
            }

            tonsOfObjects = null;
        }
예제 #7
0
        static void Finalization()
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("=> finalizers");

            Console.WriteLine("Hit the return key to shut down this app");
            Console.WriteLine("and force the GC to invoke Finalize()");
            Console.WriteLine("for finalizable objects created in this AppDomain.");
            Console.ReadLine();
            MyResourceWrapper rw = new MyResourceWrapper();
        }
예제 #8
0
 static void Main(string[] args)
 {
     Debug.WriteLine("***** Fun with Finalizers *****\n");
     Debug.WriteLine("Hit the return key to shut down this app");
     Debug.WriteLine("and force the GC to invoke Finalize()");
     Debug.WriteLine("for finalizable objects created in this AppDomain.");
     // Нажмите клавишу <Enter>, чтобы завершить приложение
     // и заставить сборщик мусора вызвать метод Finalize ()
     // для всех финализируемых объектов, которые
     // были созданы в домене этого приложения.
     var rw = new MyResourceWrapper();
 }
예제 #9
0
 static void Main(string[] args) {
     MyResourceWrapper a = new MyResourceWrapper();
 }
예제 #10
0
 static void tmp1()
 {
     MyResourceWrapper rw = new MyResourceWrapper();
 }