Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
 }
Exemplo n.º 5
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();
 }
Exemplo n.º 6
0
        private static void CreateObjects(int count)
        {
            MyResourceWrapper[] tonsOfObjects = new MyResourceWrapper[count];
            for (int i = 0; i < count; i++)
            {
                tonsOfObjects[i] = new MyResourceWrapper();
            }

            tonsOfObjects = null;
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
 }
Exemplo n.º 9
0
 static void Main(string[] args) {
     MyResourceWrapper a = new MyResourceWrapper();
 }
Exemplo n.º 10
0
 static void tmp1()
 {
     MyResourceWrapper rw = new MyResourceWrapper();
 }