• λ我爱Aspx >> Asp.Net >> $$$ public event MyDelegate OnOccurUseDelegate; 这行的event有什么用?
  • $$$ public event MyDelegate OnOccurUseDelegate; 这行的event有什么用?

  • :aspxer  Դ:csdn  :2007-7-6 2:50:47  ؼ:
  • namespace ConsoleApplication1

    google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_color_url = "000000";

    {

    public delegate void MyDelegate(string abc);

    class ClassA

    {

    public event MyDelegate OnOccurUseDelegate; //这行的event可用可不用

    public event EventHandler OnOccurUseEventHandler;//这行的event可用可不用

    public void Run()

    {

    Console.WriteLine("ClassA Run()");

    Console.WriteLine("invoke the Onccur");

    OnOccurUseDelegate("OnOccurUseDelegate");

    OnOccurUseEventHandler(this, EventArgs.Empty);

    }

    }

    class ClassB

    {

    public ClassB(ClassA a)

    {

    a.OnOccurUseDelegate += new MyDelegate(Run);

    a.OnOccurUseEventHandler += new EventHandler(Run);

    }

    private void Run(string abc)

    {

    Console.WriteLine(abc);

    Ҷƪл˵?
  • һƪ首页如何做导航
    һƪ问一下,winform大家用何种方式显示数据