Click here to Skip to main content
15,920,603 members
Home / Discussions / C#
   

C#

 
QuestionWho can help ? Pin
Mohammad Dayyan18-Sep-08 10:03
Mohammad Dayyan18-Sep-08 10:03 
AnswerRe: Who can help ? Pin
Giorgi Dalakishvili18-Sep-08 10:14
mentorGiorgi Dalakishvili18-Sep-08 10:14 
AnswerRe: Who can help ? Pin
Eslam Afifi18-Sep-08 15:15
Eslam Afifi18-Sep-08 15:15 
GeneralRe: Who can help ? Pin
Mohammad Dayyan19-Sep-08 2:25
Mohammad Dayyan19-Sep-08 2:25 
AnswerRe: Who can help ? Pin
Eslam Afifi19-Sep-08 4:12
Eslam Afifi19-Sep-08 4:12 
GeneralRe: Who can help ? Pin
Mohammad Dayyan19-Sep-08 4:31
Mohammad Dayyan19-Sep-08 4:31 
GeneralRe: Who can help ? Pin
Eslam Afifi19-Sep-08 5:53
Eslam Afifi19-Sep-08 5:53 
QuestionReliabilityContractAttribute Pin
HosamAly18-Sep-08 9:26
HosamAly18-Sep-08 9:26 
Hello,

I am trying to understand the CER feature, but I am not very confident that I understand it well. I have read a number of articles about it, but I still need to check whether I understand it correctly. I hope you could help me.

First, I apologize for this long post. I thought it is necessary to clarify my question. I'm thankful for your patience.

I am implementing a SafeHandle, and the release code looks like this:
class MySafeHandle : SafeHandle {
    protected override bool ReleaseHandle() {
        MyClass.freeHandle(handle);
        return !MyClass.CheckErrors(false);
    }
}
class MyClass {
    internal static extern void freeHandle(MySafeHandle handle);
    internal static extern bool checkExternalErrors();

    internal static bool CheckErrors(bool throwExceptionOnError) {
        if (!checkExternalErrors()) return false;
        if (throwExceptionOnError) throw new Exception();
        return true;
    }
}

I'm not sure what to label freeHandle, checkExternalErrors and CheckErrors. freeHandle wouldn't tell whether there is an error; I have to call CheckErrors for that. But it will never throw an exception either, so I'm thinking it should be labeled [Cer.Success].

Meanwhile, CheckErrors may throw an exception, depending on the throwExceptionOnError parameter. So I think this should be labeled [Cer.MayFail]. But I don't really know... wouldn't that violate the CER on ReleaseHandle? Also what should I label checkExternalErrors? Does it not need a label? Or does it still need [ReliabilityContractAttribute(Consistency.WillNotCorruptState)]? I really feel confused!

Thanks a lot for your patience! Even if you don't answer, I'm grateful that you read this post to the end. Smile | :)
Questionhow to fire button1_click event while pressing enter key Pin
Shuaib wasif khan18-Sep-08 8:39
Shuaib wasif khan18-Sep-08 8:39 
AnswerRe: how to fire button1_click event while pressing enter key Pin
DaveyM6918-Sep-08 8:56
professionalDaveyM6918-Sep-08 8:56 
AnswerRe: how to fire button1_click event while pressing enter key Pin
Alan N18-Sep-08 8:58
Alan N18-Sep-08 8:58 
QuestionHow to convert an object array to string Pin
soniaiq18-Sep-08 7:32
soniaiq18-Sep-08 7:32 
AnswerRe: How to convert an object array to string Pin
DaveyM6918-Sep-08 7:37
professionalDaveyM6918-Sep-08 7:37 
GeneralRe: How to convert an object array to string Pin
soniaiq18-Sep-08 7:47
soniaiq18-Sep-08 7:47 
GeneralRe: How to convert an object array to string Pin
DaveyM6918-Sep-08 8:34
professionalDaveyM6918-Sep-08 8:34 
GeneralRe: How to convert an object array to string Pin
srabik18-Sep-08 13:18
srabik18-Sep-08 13:18 
AnswerRe: How to convert an object array to string Pin
Paul Conrad18-Sep-08 7:46
professionalPaul Conrad18-Sep-08 7:46 
Question[Message Deleted] Pin
soniaiq18-Sep-08 7:59
soniaiq18-Sep-08 7:59 
AnswerRe: How to convert an object array to string Pin
Paul Conrad18-Sep-08 8:04
professionalPaul Conrad18-Sep-08 8:04 
GeneralRe: How to convert an object array to string Pin
soniaiq18-Sep-08 8:15
soniaiq18-Sep-08 8:15 
GeneralRe: How to convert an object array to string Pin
Paul Conrad18-Sep-08 8:16
professionalPaul Conrad18-Sep-08 8:16 
QuestionStartup Project in VS2005 Pin
Vimalsoft(Pty) Ltd18-Sep-08 6:53
professionalVimalsoft(Pty) Ltd18-Sep-08 6:53 
QuestionSalted hash - Storing Salt In password or a seperate field [modified] Pin
DotNetWWW18-Sep-08 6:41
DotNetWWW18-Sep-08 6:41 
AnswerRe: Salted hash - Storing Salt In password or a seperate field Pin
N a v a n e e t h18-Sep-08 7:12
N a v a n e e t h18-Sep-08 7:12 
GeneralRe: Salted hash - Storing Salt In password or a seperate field Pin
Paul Conrad18-Sep-08 7:48
professionalPaul Conrad18-Sep-08 7:48 

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.