Click here to Skip to main content
15,899,124 members
Home / Discussions / C#
   

C#

 
GeneralRe: Editable Grid Pin
ProffK3-Jan-06 0:30
ProffK3-Jan-06 0:30 
GeneralRe: Editable Grid Pin
joe carbone3-Jan-06 3:56
joe carbone3-Jan-06 3:56 
QuestionDisabling compiler error? Pin
joachimj2-Jan-06 23:31
joachimj2-Jan-06 23:31 
AnswerRe: Disabling compiler error? Pin
mav.northwind3-Jan-06 0:19
mav.northwind3-Jan-06 0:19 
GeneralRe: Disabling compiler error? Pin
joachimj3-Jan-06 1:38
joachimj3-Jan-06 1:38 
AnswerRe: Disabling compiler error? Pin
Colin Angus Mackay3-Jan-06 2:12
Colin Angus Mackay3-Jan-06 2:12 
GeneralRe: Disabling compiler error? Pin
joachimj3-Jan-06 2:58
joachimj3-Jan-06 2:58 
GeneralRe: Disabling compiler error? Pin
Colin Angus Mackay3-Jan-06 3:11
Colin Angus Mackay3-Jan-06 3:11 
oh... I see now... The method SomeMEthodWithSideEffect() isn't actually throwing the exception, its calling another method to do that. I must have misunderstood what you were doing. The compiler doesn't know about the other method or that it only ever throws an exception, it just knows where it is to call it.

I would suggest that your NullOjectHelper does what it needs to do in order to construct the exeption and do the logging you need. Then return the exception object and you then throw it from where you need it. So your code becomes:
// ...Snip for brevity...
public int SomeMethodWithSideEffect() 
{
    throw NullObjectHelper.Throw_InvalidToCallOrSetOnNullObject(); 
}
// ...Snip for brevity...

 
class NullObjectHelper
{
    public static Exception Throw_InvalidToCallOrSetOnNullObject()
    {
       return new ApplicationException("Cannot set properties or change state of null objects.");
    }
} // class NullObjectHelper
Then the compiler can see that an exception is being thrown.



ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

GeneralRe: Disabling compiler error? Pin
joachimj3-Jan-06 3:14
joachimj3-Jan-06 3:14 
GeneralRe: Disabling compiler error? Pin
J4amieC3-Jan-06 4:06
J4amieC3-Jan-06 4:06 
GeneralRe: Disabling compiler error? Pin
joachimj3-Jan-06 4:21
joachimj3-Jan-06 4:21 
GeneralRe: Disabling compiler error? Pin
J4amieC3-Jan-06 5:18
J4amieC3-Jan-06 5:18 
Questionculture info Pin
PrakashBhaskar2-Jan-06 23:19
PrakashBhaskar2-Jan-06 23:19 
AnswerRe: culture info Pin
S. Akif Kamal3-Jan-06 1:15
S. Akif Kamal3-Jan-06 1:15 
AnswerRe: culture info Pin
Colin Angus Mackay3-Jan-06 2:15
Colin Angus Mackay3-Jan-06 2:15 
GeneralRe: culture info Pin
PrakashBhaskar3-Jan-06 2:19
PrakashBhaskar3-Jan-06 2:19 
QuestionMy app won't run: "unverifiable assembly" Pin
navvara the infantryman2-Jan-06 22:15
navvara the infantryman2-Jan-06 22:15 
AnswerRe: My app won't run: "unverifiable assembly" Pin
mav.northwind3-Jan-06 0:11
mav.northwind3-Jan-06 0:11 
GeneralRe: My app won't run: "unverifiable assembly" Pin
navvara the infantryman3-Jan-06 1:35
navvara the infantryman3-Jan-06 1:35 
GeneralRe: My app won't run: "unverifiable assembly" Pin
J4amieC3-Jan-06 1:43
J4amieC3-Jan-06 1:43 
GeneralRe: My app won't run: "unverifiable assembly" Pin
navvara the infantryman3-Jan-06 1:55
navvara the infantryman3-Jan-06 1:55 
GeneralRe: My app won't run: "unverifiable assembly" Pin
J4amieC3-Jan-06 4:07
J4amieC3-Jan-06 4:07 
AnswerRe: My app won't run: "unverifiable assembly" Pin
leppie3-Jan-06 6:57
leppie3-Jan-06 6:57 
QuestionCan i call the properties window of a specific File from my Application? Pin
shaimaa-galal2-Jan-06 22:02
shaimaa-galal2-Jan-06 22:02 
AnswerRe: Can i call the properties window of a specific File from my Application? Pin
albCode2-Jan-06 22:13
albCode2-Jan-06 22:13 

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.