TracedEvent.AttachIfNotFired(Action, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attach the event handler only if the event has not fired before.
You may specify invokeIfFired
= true if you want to invoke the handler
right away
if the event has fired before.
public bool AttachIfNotFired (Action handler, bool invokeIfFired = false);
member this.AttachIfNotFired : Action * bool -> bool
Public Function AttachIfNotFired (handler As Action, Optional invokeIfFired As Boolean = false) As Boolean
Parameters
- handler
- Action
The event handler to attach, not null.
- invokeIfFired
- Boolean
A value indicating whether to invoke the handler
if the event has fired before.
Returns
True if the handler is attached; Otherwise, false.