⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch2_08.cs

📁 《c#技术内幕代码》
💻 CS
字号:
using System;

class CH2_8
{
   static int ReferenceCount;
   
   private static void IncrementReferenceCount()
   {
      // Here we would do any synchronization needed
      // for multi-threaded apps.
      ReferenceCount++;
      Console.WriteLine("IncrementReferenceCount {0}", ReferenceCount);
      // Here we would release the synchronization flag
   }
   private static void DecrementReferenceCount()
   {
      // Here we would do any synchronization needed
      // for multi-threaded apps.
      ReferenceCount--;
      Console.WriteLine("DecrementReferenceCount {0}", ReferenceCount);
      // Here we would release the synchronization flag
   }
   
   public CH2_8()
   {
      IncrementReferenceCount();
   }
   ~CH2_8()
   {
      DecrementReferenceCount();
   }
   void Dispose()
   {
      Finalize();
      GC.SuppressFinalize(this);
   }
   

   public static void Main()
   {
      CH2_8 app = new CH2_8();
      app.Dispose();
   }
}

   
   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -