Click here to Skip to main content
12,504,560 members (56,052 online)
   

C#

 
AnswerRe: build C# as windows app Pin
Pete O'Hanlon31-Jan-13 23:40
protectorPete O'Hanlon31-Jan-13 23:40 
QuestionC# and ADP (Automatic Data Processing) integration Pin
Dan_YYC31-Jan-13 5:18
memberDan_YYC31-Jan-13 5:18 
AnswerRe: C# and ADP (Automatic Data Processing) integration Pin
Dan_YYC4-Feb-13 3:56
memberDan_YYC4-Feb-13 3:56 
QuestionAuto relocate a label Pin
justcop31-Jan-13 4:41
memberjustcop31-Jan-13 4:41 
AnswerRe: Auto relocate a label Pin
Abhinav S31-Jan-13 6:13
mvpAbhinav S31-Jan-13 6:13 
AnswerRe: Auto relocate a label Pin
Dave Kreskowiak31-Jan-13 7:02
mvpDave Kreskowiak31-Jan-13 7:02 
AnswerRe: Auto relocate a label Pin
Eddy Vluggen31-Jan-13 10:22
mvpEddy Vluggen31-Jan-13 10:22 
QuestionUpload files over HTTPS Pin
Edis Husic31-Jan-13 1:37
memberEdis Husic31-Jan-13 1:37 
QuestionADAM LDAP Authentification via user distinguishedName Pin
mappy7501730-Jan-13 22:41
membermappy7501730-Jan-13 22:41 
QuestionSubreport Pin
theezin30-Jan-13 22:16
membertheezin30-Jan-13 22:16 
AnswerRe: Subreport Pin
Pete O'Hanlon30-Jan-13 22:22
protectorPete O'Hanlon30-Jan-13 22:22 
QuestionHow to write c# version of Delphi's Abort procedure Pin
Xiaoming Qian30-Jan-13 18:46
memberXiaoming Qian30-Jan-13 18:46 
AnswerRe: How to write c# version of Delphi's Abort procedure Pin
Richard MacCutchan30-Jan-13 22:07
mvpRichard MacCutchan30-Jan-13 22:07 
AnswerRe: How to write c# version of Delphi's Abort procedure Pin
Shameel31-Jan-13 0:18
memberShameel31-Jan-13 0:18 
Assuming that you wish to exit out of all try blocks and continue execution from the line next to the last finally block, you can try this:

try //application level try .. finally block
{
  try
  {
    ...
    try //Current level try .. finally block
    {
      ...
      // Throw a SilentException that will only catched by application level try .. finally block
      // and redirects execution to the end of application level try .. finally block
      throw new MyCustomException();
      ...
    }
    catch (MyExeption1 ex)
    {
    }
  }
  catch (MyExeption2 ex)
  {
  }
}
catch (MyCustomException ex)
{
}
finally
{
}
 
//Execution will continue from here

What this code basically does is exploit the behavior of try catch blocks. When an exception is not handled by the inner catch block, the next outer catch block will try to handle it and so on. Note that all finally blocks will be executed anyway, if you do not wish this to happen, you can control the code flow with flag variables.

Points to keep in mind:
1. Don't handle any super-class of the exceptions raised in the respective catch blocks.
2. Don't handle System.Exception in the inner catch blocks.

A better way would be to re-design your code and make it modular with multiple outer try catch blocks and avoid 'block jumps'.
AnswerRe: How to write c# version of Delphi's Abort procedure Pin
jschell31-Jan-13 8:21
memberjschell31-Jan-13 8:21 
Question"new" to hide base class implementation - is it useless? Pin
devvvy30-Jan-13 18:17
memberdevvvy30-Jan-13 18:17 
AnswerRe: "new" to hide base class implementation - is it useless? Pin
Keld Ølykke30-Jan-13 20:03
memberKeld Ølykke30-Jan-13 20:03 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
devvvy30-Jan-13 20:11
memberdevvvy30-Jan-13 20:11 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
Keld Ølykke30-Jan-13 23:45
memberKeld Ølykke30-Jan-13 23:45 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
devvvy31-Jan-13 15:33
memberdevvvy31-Jan-13 15:33 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
Keld Ølykke31-Jan-13 20:56
memberKeld Ølykke31-Jan-13 20:56 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
devvvy1-Feb-13 14:54
memberdevvvy1-Feb-13 14:54 
AnswerRe: "new" to hide base class implementation - is it useless? Pin
markovl30-Jan-13 21:20
membermarkovl30-Jan-13 21:20 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
devvvy31-Jan-13 15:30
memberdevvvy31-Jan-13 15:30 
AnswerRe: "new" to hide base class implementation - is it useless? Pin
Shameel31-Jan-13 1:07
memberShameel31-Jan-13 1:07 
AnswerRe: "new" to hide base class implementation - is it useless? Pin
Abhinav S31-Jan-13 6:25
mvpAbhinav S31-Jan-13 6:25 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
devvvy31-Jan-13 15:40
memberdevvvy31-Jan-13 15:40 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
Abhinav S31-Jan-13 22:26
mvpAbhinav S31-Jan-13 22:26 
GeneralRe: "new" to hide base class implementation - is it useless? Pin
devvvy1-Feb-13 14:56
memberdevvvy1-Feb-13 14:56 
QuestionCatching unhandled ThreadAbortException from Main? Pin
devvvy30-Jan-13 14:56
memberdevvvy30-Jan-13 14:56 
AnswerRe: Catching unhandled ThreadAbortException from Main? Pin
Andy41130-Jan-13 22:37
memberAndy41130-Jan-13 22:37 
AnswerRe: Catching unhandled ThreadAbortException from Main? Pin
Shameel31-Jan-13 3:49
memberShameel31-Jan-13 3:49 
AnswerRe: Catching unhandled ThreadAbortException from Main? Pin
jschell31-Jan-13 8:29
memberjschell31-Jan-13 8:29 
GeneralRe: Catching unhandled ThreadAbortException from Main? Pin
devvvy31-Jan-13 15:43
memberdevvvy31-Jan-13 15:43 
GeneralRe: Catching unhandled ThreadAbortException from Main? Pin
jschell2-Feb-13 7:53
memberjschell2-Feb-13 7:53 
AnswerRe: Catching unhandled ThreadAbortException from Main? Pin
Keld Ølykke31-Jan-13 21:15
memberKeld Ølykke31-Jan-13 21:15 
QuestionGo to finally in try block Pin
vanikanc30-Jan-13 7:25
membervanikanc30-Jan-13 7:25 
AnswerRe: Go to finally in try block Pin
jibesh30-Jan-13 7:35
memberjibesh30-Jan-13 7:35 
GeneralRe: Go to finally in try block Pin
vanikanc30-Jan-13 7:37
membervanikanc30-Jan-13 7:37 
GeneralRe: Go to finally in try block Pin
jibesh30-Jan-13 7:41
memberjibesh30-Jan-13 7:41 
GeneralRe: Go to finally in try block Pin
vanikanc30-Jan-13 7:42
membervanikanc30-Jan-13 7:42 
GeneralRe: Go to finally in try block Pin
jibesh30-Jan-13 7:44
memberjibesh30-Jan-13 7:44 
GeneralRe: Go to finally in try block Pin
devvvy31-Jan-13 15:44
memberdevvvy31-Jan-13 15:44 
AnswerRe: Go to finally in try block Pin
Eddy Vluggen30-Jan-13 7:45
mvpEddy Vluggen30-Jan-13 7:45 
AnswerRe: Go to finally in try block Pin
PIEBALDconsult30-Jan-13 7:53
memberPIEBALDconsult30-Jan-13 7:53 
AnswerRe: Go to finally in try block Pin
jschell30-Jan-13 8:04
memberjschell30-Jan-13 8:04 
AnswerRe: Go to finally in try block Pin
Abhinav S30-Jan-13 21:32
mvpAbhinav S30-Jan-13 21:32 
AnswerRe: Go to finally in try block Pin
V.30-Jan-13 22:10
memberV.30-Jan-13 22:10 
AnswerRe: Go to finally in try block Pin
Rahul Rajat Singh30-Jan-13 22:15
mvpRahul Rajat Singh30-Jan-13 22:15 
AnswerRe: Go to finally in try block Pin
Rahul Rajat Singh30-Jan-13 22:18
mvpRahul Rajat Singh30-Jan-13 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 27 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid