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

📄 ch6_1test.cs

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

public enum DayOfTheWeek
{
	Monday,
	Tuesday,
	Wednesday,
	Thursday,
	Friday,
	Saturday,
	Sunday
};

public struct _SYSTEM_INFO
{ 
   public int dwOemID; 
   public int dwPageSize;
   public int lpMinimumApplicationAddress; 
   public int lpMaximumApplicationAddress; 
   public int dwActiveProcessorMask; 
   public int dwNumberOfProcessors;
   public int dwProcessorType;
   public int dwAllocationGranularity;
   public short wProcessorLevel;
   public short wProcessorRevision;
}


public interface Channel
{
   void Next();
   void Previous();
}

public class TestIntf : Channel
{
   public void Next()
   {
      Console.WriteLine("Channel Next");
   }
   public void Previous()
   {
      Console.WriteLine("Previous");
   }
}

public class EventTestClass
{
     // The value to track
     private int nValue;
     
     // Allow a handler for the event
     public delegate Boolean ValueChangedEventHandler(int nValue);
     
     // This is the event itself
     public event ValueChangedEventHandler Changed;

     // This method is used to fire the event     
     protected virtual Boolean OnChanged(int nV) 
     {
        if (Changed != null)
           return Changed(nV);
        else
           Console.WriteLine("Event fired. No handler!");
	return true;
    
     }
     public EventTestClass(int nValue)
     {
        SetValue( nValue );
     }
     public void SetValue( int nV )
     {
        if ( nValue != nV )
        {
            if ( OnChanged(nV) )
               nValue = nV;
            // Fire the event
        }
     }
     public static void Main()
     {
     }
    
}

⌨️ 快捷键说明

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