Changes between Version 3 and Version 4 of Raise
- Timestamp:
- 11/22/12 01:00:38 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Raise
v3 v4 1 1 = Raise = 2 2 3 Trigger an event to fire with the specified args.3 Raises an event which will directly notify any [wiki:Listen listeners] for that event. An event can only be raised for the same class and the same instance. 4 4 5 If the event is not null and any handlers are listening (registered with) [[BR]] 6 the event they will be invoked after the event has been raised. 5 The number and types of args given in the raise statement must match those declared in the [wiki:Delegate sig] used as the type for the event being raised with two exceptions: 7 6 8 The number and types of args given in the raise statement must match those declared [[BR]] 9 in the sig used as the Type for the event being raised. 7 1. The `sender` which is always `this` should not be specified. 8 2. The event arguments object can be left out if you are happy with a default instantiation. 9 10 This will become more clear in the examples below. 10 11 11 12 See also [wiki:Listen] and [wiki:Ignore]. … … 154 155 }}} 155 156 157 == Notes == 156 158 157 == Notes == 159 In C#, the programmer must first check if the event is null before invoking it. This is not necessary in Cobra where `raise .someEvent ...` is all that is required. 160 161 == See Also == 162 163 * [wiki:Listen] 164 * [wiki:Ignore] 165 * [wiki:AllStatements] 166 * [wiki:LanguageTopics]