![]() |
Manually cancelling a Command
Hello,
I am trying to create a Command subclass which listens for an interrupt to cancel the command. When cancelling the command, I have tried using the Cancel() method, but it fails when the command is part of a CommandGroup. Is there a universal way to forcibly end a command from within the command itself? EDIT: Also, can the Cancel() method be used on a CommandGroup object? If so, I could work around this issue. |
Re: Manually cancelling a Command
Within your command:
Code:
if(getGroup() != null) getGroup().cancel(); |
Re: Manually cancelling a Command
Quote:
|
Re: Manually cancelling a Command
Quote:
|
Re: Manually cancelling a Command
Quote:
|
Re: Manually cancelling a Command
Quote:
|
Re: Manually cancelling a Command
Quote:
|
Re: Manually cancelling a Command
Quote:
|
Re: Manually cancelling a Command
Quote:
You can see there is no polling involved. That's the advantage of interrupts. The disadvantage is that interrupts can occur at any time -- asynchronously -- so you have to be careful when using them. |
| All times are GMT -5. The time now is 11:01. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi