Home Notices Documents Classes Download Others Rice
Classes  >  ehswitch  >  StopWithException(bool)
ehswitch class : StopWithException(bool) setter

Description

Sets a value that indicates whether the eventhandler will automatically be stopped if the execution finished with the exception.

Syntax

ehswitchInstance.StopWithException = stop

Arguments

ClassNameDescription
boolstopA value that indicates whether the eventhandler will automatically be stopped if the execution finished with the exception.

Return value

None

Sample code

Suppose you have the following class definition.

1:

class handle

2:

...

3:

open fitter handle()

4:

// any initialization code...

5:

endfitter

6:

...

7:

open method void handler(eventargs ea)

8:

// any handling code....

9:

endmethod

10:

...

11:

endclass

Usage of the StopWithException setter is as follows.

1:

browser b = new browser();

2:

handle h = new handle();

3:

ehswitch ehs = b.Load(h,"handler(eventargs)");

4:

ehs.StopWithException = false; // Sets false. The handler never stop even if an exception occur.

5:

ehs.Start(); // Starts handling.

Notes

Sets true if the eventhandler will automatically be stopped. Otherwise, sets false.

The defalut is true.

Links for reference

None

Copyright © Rice All rights reserved.