cancel

call a function when the program is finished with ctrl c

Hello, I am working in the Linux environment, and I have a C++ program, what I want is when I cancel the program with ctrl+c I would like that the program executes a function, to close some files and print some sutff, is there any way to do this?. Thank you. ...

How can I cancel a user's WPF TreeView click?

I've got a WPF application with a Treeview control. When the user clicks a node on the tree, other TextBox, ComboBox, etc. controls on the page are populated with appropriate values. The user can then make changes to those values and save his or her changes by clicking a Save button. However, if the user selects a different Treeview n...

How do I properly handle a PreviewMouseDown event with a MessageBox confirmation?

Earlier I asked how to cancel a WPF TreeViewItem.Selected event. The answerers suggested I instead handle the PreviewMouseDown event before the selection even takes place. That makes sense. I've tried to do that... XAML... <TreeView Name="TreeViewThings" ... PreviewMouseDown="TreeViewThings_PreviewMouseDown" TreeViewItem...

How to impement an event which can be canceled?

Help me please to implement an event, which handler can cancel it. public class BuildStartEventArgs : EventArgs { public bool Cancel { get; set; } } class Foo { public event EventHandler<BuildStartEventArgs> BuildStart; private void Bar() { // build started OnBuildStart(new BuildStartEventArgs()); // how...

C#: Is it possible to cancel a linq2sql query?

Is it possible to cancel a linq2sql query? Like if I have built a query that takes a while to run, I would like it to be possible for the user to cancel it. Does anyone have any good ideas on this? ...

How to cancel a routed event?

I have a WPF application, where when a user unchecks a checkbox, the application will prompt to confirm. If the user chooses not to continue (cancel) is selected, i want to cancel the uncheck event. In another word, i want the checkbox to remain checked. How can i do that in WPF? Thanks in advance. ...

Is there a way to detect cancelled download?

Let's say I have a Spring MVC web application and it allows users to download a file. An email is sent at the same time as the file is sent to the user. Is there a way to detect cancelled download so I could send the email only if the download has been successful? ...

C# game design - main loop aborting - A better way than Abort() and ResetAbort()?

i have some C# threading program (a game), that stops with a boolean (as most articles recommends). while (gameContinueRun) { createRound(); line1; line2; line3; line4; endRound(); } some code lines lock the game and wait until other thread will release it. lock (stateSync) { Monitor.Wait(stateSync) } to stop the thre...

Backgroundworker : exception during cancellation

I have a background worker wich can be cancelled. The normal flows interrupt itself when the CancelPending variable turns to true (responding to user interaction on UI wich call worker.CancelAsynch() ) , exceptions are thrown because if that (since normal flow is interrupted, lots of null ref exception are thrown) So when the worker r...

Remove / Clear Error message tool tips on Cancel button click.

Hi, I have referred this for creating error message tool tips, to be displayed continuously unless the error is resolved by the user. :: http://aralbalkan.com/1125 ..................... But, this is being applied to a pop-up window visualized as a pop-up form. When the user clicks 'CANCEL' button, I want the error message tooltips if ...

Jeditable CANCEL callback from AJAX callback?

Hello, I see some answers for the Jeditable plugin to use a callback function from AJAX using complete callback function. I know that the Jeditable has a callback function for the SUBMIT button, so I would like to know if there is a way to have a callback for the CANCEL button? I haven't found on the plugin docs. Thanks for reply, Ca...

How to abandon a long-running search in System.DirectoryServices.Protocols

I've been trying to work out how to cancel a long-running AD search in System.DirectoryServices.Protocols. Can anyone help? I've looked at the supportControl/supportedCapabilities attributes on RootDSE and they don't contain the 1.3.6.1.1.8 OID so I think that means it doesn't support the LDAP CANCEL extended operation as defined here:...

Cancel a running build process in VS

Is it possible to cancel/abort a running build process in Visual Studio 2008? How? ...

Access: Canceling Report generation causes error 2501

Hi can't believe I am losing so much time on this one. I have an order form, and when I click on a button "reports", a dialog pop ups with a list of different reports to chose from. Double-clicking selects and starts the correspondent report. On one of these reports, there is an unbound text box I need the user to enter data with. Th...

cancel mouse events

i'm using a mouse event for an outer element. how to cancel the from triggering by sub elements with reasonably small code <div onmouseout='myfunc()'> <div>item1</div> <div>item2</div> ............... <div>item n</div> </div> mouseevent should not apply to item1 to n ...

ASP.NET MVC: The correct way to handle a cancel button

I'm wanting to have a simple cancel button so on confirmation of, say, the deletion of a product, they can change their mind and click cancel before the actual delete action is started. I figure that on clicking the button you are wanting to redirect the user to the previous page. I understand that a common way to handle this is with ja...

DataTable Cancel Row Delete

Hi, I have a windows form which has a DataGrid control (Not DataGridView) on it. The DataGrid control is bound ot to a DataTable. Everytime the user presses delete button on one of the rows on the grid, I want to check a condition and stop the row from being deleted if the condition is false. I have subscribed to the RowDeleting ev...

Workflows C#, how to break out of execution

At the moment I am using fault handlers to break out of execution e.g: State1: HandleExternalEvent -> MyCode (possibly throw exception) -> Change state2 ->Fault handler ->no code (i.e stays in state1) However I am suffering from a performace hit, is there away to perform the same action without using exceptions/fault handle, like ...

Jquery star rating plugin and cancel rating button

Using this plugin: http://www.fyneworks.com/jquery/star-rating/#tab-Testing I have a simple callback function that picks up the id from the radio buttons: <input type="radio" class="auto-submit-star {split:2}" id="myid" value="1" /> $('.auto-submit-star').rating({ callback: function(value, link){ alert($(this).attr('id')); } ...

how to handle push notification if application is already running?

how do we handle push notification if app is already running? means i want to show an alert if app is running instead of push notification alert.if app is not running then show push notification alert.also tell me that if i send a payload to APNs how do i cancel the payload? ...