Click here to Skip to main content
15,913,836 members
Home / Discussions / C#
   

C#

 
AnswerRe: Catch all but a specific exception Pin
Richard Andrew x6422-May-12 5:19
professionalRichard Andrew x6422-May-12 5:19 
SuggestionRe: Catch all but a specific exception Pin
Cracked-Down23-May-12 2:01
Cracked-Down23-May-12 2:01 
GeneralRe: Catch all but a specific exception Pin
Bernhard Hiller23-May-12 4:29
Bernhard Hiller23-May-12 4:29 
AnswerRe: Catch all but a specific exception Pin
Cracked-Down23-May-12 4:49
Cracked-Down23-May-12 4:49 
GeneralRe: Catch all but a specific exception Pin
Cracked-Down27-May-12 21:00
Cracked-Down27-May-12 21:00 
Questionblocking USB ports Pin
Pritam Dalvi21-May-12 21:58
Pritam Dalvi21-May-12 21:58 
AnswerRe: blocking USB ports Pin
Richard MacCutchan21-May-12 22:58
mveRichard MacCutchan21-May-12 22:58 
QuestionDelegate Conversion to Method? [Solved] Pin
Ravi Sant21-May-12 21:06
Ravi Sant21-May-12 21:06 
Hi,

I have a code to debug, which in delegate block as below.
Since even the F11 steps through it, i think of extracting method out of delegate.
I googled much about this with no ready-help.

private List<IProduct> GetPaginatedProduct(bool IsCalled, IProductPageSortOption paginationOption, IEnumerable<ICustomCriteria> additionalCriteria,string reportStartDate, string reportEndDate)
{

  HibernateDelegate<IList<ProductStaticDataDBBean>> hibDel = delegate(ISession session)
  {
    ....
    //do something with session .. about 300 lines of code...
    ....
  }

}


My question is:
Can I call it like: say delegate(ISession session){ call some function(..) }.
So that I effectively replace inline code with a function call.
Please guide.
Thanks.


Edit: I was not able to break into anonymous code.
Refactoring the delegates to call few methods, containing anonymous code above, made task easier.

// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫


Tell your manager, while you code: "good, cheap or fast: pick two. "


modified 22-May-12 6:00am.

AnswerRe: Delegate Conversion to Method? Pin
Keith Barrow21-May-12 21:59
professionalKeith Barrow21-May-12 21:59 
GeneralRe: Delegate Conversion to Method? Pin
Ravi Sant21-May-12 23:57
Ravi Sant21-May-12 23:57 
GeneralRe: Delegate Conversion to Method? Pin
Keith Barrow22-May-12 1:38
professionalKeith Barrow22-May-12 1:38 
AnswerRe: Delegate Conversion to Method? Pin
BobJanova22-May-12 0:06
BobJanova22-May-12 0:06 
QuestionBarcode in crystal Report in C# Pin
Member 360103421-May-12 21:04
Member 360103421-May-12 21:04 
AnswerRe: Barcode in crystal Report in C# Pin
Richard MacCutchan21-May-12 22:57
mveRichard MacCutchan21-May-12 22:57 
QuestionWhy no compiler warning in this code? Pin
Tom Clement21-May-12 9:40
professionalTom Clement21-May-12 9:40 
AnswerRe: Why no compiler warning in this code? Pin
Pete O'Hanlon21-May-12 10:03
mvePete O'Hanlon21-May-12 10:03 
GeneralRe: Why no compiler warning in this code? Pin
Tom Clement21-May-12 11:58
professionalTom Clement21-May-12 11:58 
GeneralRe: Why no compiler warning in this code? Pin
Pete O'Hanlon21-May-12 22:15
mvePete O'Hanlon21-May-12 22:15 
AnswerRe: Why no compiler warning in this code? Pin
OriginalGriff21-May-12 21:09
mveOriginalGriff21-May-12 21:09 
AnswerRe: Why no compiler warning in this code? Pin
Bernhard Hiller21-May-12 23:25
Bernhard Hiller21-May-12 23:25 
AnswerRe: Why no compiler warning in this code? Pin
BobJanova21-May-12 23:55
BobJanova21-May-12 23:55 
GeneralRe: Why no compiler warning in this code? Pin
Tom Clement22-May-12 3:38
professionalTom Clement22-May-12 3:38 
GeneralRe: Why no compiler warning in this code? Pin
Sentenryu22-May-12 9:30
Sentenryu22-May-12 9:30 
Questionsearch on a particular sheet Excel workbook Pin
Maximmm21-May-12 5:30
Maximmm21-May-12 5:30 
AnswerRe: search on a particular sheet Excel workbook Pin
PIEBALDconsult21-May-12 7:11
mvePIEBALDconsult21-May-12 7:11 

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.