示例#1
0
  static int Test2() {
    Test.EventTest2.SomeComponent ie = Test.EventTest2.mk();
    ie.SomeEvent += onEvent;
    FSharpHandler<string> seh = new FSharpHandler<string>(onEvent);
    ie.SomeEvent += seh;
    Test.EventTest2.fire(ie);
    ie.SomeEvent -= seh;

    ie.Paint += onPaint;
    FSharpHandler<EventArgs> peh = new FSharpHandler<EventArgs>(onPaint);
    ie.Paint += peh;
    Test.EventTest2.fire(ie);
    ie.Paint -= peh;

    Test.EventTest2.fire(ie);
    return 0;
  }
示例#2
0
    static int Test2()
    {
        Test.EventTest2.SomeComponent ie = Test.EventTest2.mk();
        ie.SomeEvent += onEvent;
        FSharpHandler <string> seh = new FSharpHandler <string>(onEvent);

        ie.SomeEvent += seh;
        Test.EventTest2.fire(ie);
        ie.SomeEvent -= seh;

        ie.Paint += onPaint;
        FSharpHandler <EventArgs> peh = new FSharpHandler <EventArgs>(onPaint);

        ie.Paint += peh;
        Test.EventTest2.fire(ie);
        ie.Paint -= peh;

        Test.EventTest2.fire(ie);
        return(0);
    }