axel stein

axel stein

  • NA
  • 4
  • 1.1k

Class with Event, finaly more work than...

Nov 16 2013 7:20 PM
Hi, this Axel nice to meet you guys.

I'm carring about events, during the last weeks.
Now after I can see how its work,  I woundering, what do I win by using of them?

Obviously at last I have to call my event, like this example
[code]
public int myProp
        {
            get { return _myProp; }
            set
            {
                if (value >= 0)
                    _myProp = value;
                else                 
                MeinEvent(this);     // call my_Event          
            }
        }
[/code]
So, it seems to me, its the same as I would call here any method?
Futhermore, to use my Event, I have to make my class ready.
myClass.MeinEvent += myEvent_Method;
And there has to be those Method "myEvent_Method"

Or is there anything I have not pass at yet?

greetings axel






Answers (1)