Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
GeneralRe: convert .mdf database file in text file Pin
Md. Marufuzzaman3-Nov-09 7:49
professionalMd. Marufuzzaman3-Nov-09 7:49 
AnswerRe: convert .mdf database file in text file Pin
Gerry Schmitz3-Nov-09 19:01
mveGerry Schmitz3-Nov-09 19:01 
QuestionSaving on a Cell C# Pin
DinoRondelly3-Nov-09 5:35
DinoRondelly3-Nov-09 5:35 
AnswerRe: Saving on a Cell C# Pin
Richard MacCutchan3-Nov-09 5:46
mveRichard MacCutchan3-Nov-09 5:46 
QuestionHow to send a BREAK signal to RS232 Pin
cansaco3-Nov-09 5:31
cansaco3-Nov-09 5:31 
AnswerRe: How to send a BREAK signal to RS232 Pin
OriginalGriff3-Nov-09 5:35
mveOriginalGriff3-Nov-09 5:35 
QuestionRegEx to match formula groups [modified] Pin
Björn T.J.M. Spruit3-Nov-09 4:15
Björn T.J.M. Spruit3-Nov-09 4:15 
AnswerRe: RegEx to match formula groups Pin
PIEBALDconsult3-Nov-09 4:42
mvePIEBALDconsult3-Nov-09 4:42 
GeneralRe: RegEx to match formula groups Pin
Björn T.J.M. Spruit3-Nov-09 4:59
Björn T.J.M. Spruit3-Nov-09 4:59 
GeneralRe: RegEx to match formula groups [modified] Pin
PIEBALDconsult3-Nov-09 5:44
mvePIEBALDconsult3-Nov-09 5:44 
GeneralRe: RegEx to match formula groups [modified] Pin
Björn T.J.M. Spruit4-Nov-09 5:09
Björn T.J.M. Spruit4-Nov-09 5:09 
AnswerRe: RegEx to match formula groups Pin
OriginalGriff3-Nov-09 5:33
mveOriginalGriff3-Nov-09 5:33 
GeneralRe: RegEx to match formula groups Pin
Björn T.J.M. Spruit4-Nov-09 23:02
Björn T.J.M. Spruit4-Nov-09 23:02 
Questioncreating a report Pin
JollyMansArt3-Nov-09 4:07
JollyMansArt3-Nov-09 4:07 
QuestionC# default interface method? Pin
Mark McArthey3-Nov-09 4:05
Mark McArthey3-Nov-09 4:05 
AnswerRe: C# default interface method? Pin
Ghydo3-Nov-09 5:07
Ghydo3-Nov-09 5:07 
GeneralRe: C# default interface method? Pin
Mark McArthey3-Nov-09 6:43
Mark McArthey3-Nov-09 6:43 
GeneralRe: C# default interface method? Pin
Ghydo3-Nov-09 7:36
Ghydo3-Nov-09 7:36 
AnswerRe: C# default interface method? Pin
PIEBALDconsult3-Nov-09 7:40
mvePIEBALDconsult3-Nov-09 7:40 
That's very confusing. What is ErrorLog supposed to be? An error to be logged or something that should log an error? It appears in your code that it is both, and that is likely to be a rather poor design.

In an application, an error occurs and you want to log it. You need a class to represent that error and you need a class to handle logging the error.

In most cases, your error class should derive from System.Exception. Your error logging class should then handle such errors.

namespace Library
{
    interface IErrorLog
    {
        void WriteLog ( System.Exception Error ) ;
    }

    public class ErrorLog : IErrorLog
    {
        // Constructor

        void WriteLog
        (
            System.Exception Error
        )
        {
            // Perhaps write to the Console
        }
    }
}


Other ErrorLogs can then be derived to log to other destinations.


You can then instantiate an ErrorLog and call el.WriteLog ( someexception ) ;

But I'm wondering whether or not you are trying to write someexception.Log ( el ) ;
If so, you could write an Extension Method to accomplish that:

public static void
Log
(
    this System.Exception Error
,
    IErrorLog             ErrorLog
)
{
    ErrorLog.WriteLog ( Error ) ;
}


(None of this code has been tested.)
AnswerRe: C# default interface method? Pin
Gerry Schmitz3-Nov-09 19:09
mveGerry Schmitz3-Nov-09 19:09 
QuestionIssue Launching UI Application from windows service in c# Windows Pin
platso_5883-Nov-09 3:46
platso_5883-Nov-09 3:46 
AnswerRe: Issue Launching UI Application from windows service in c# Windows Pin
Covean3-Nov-09 4:07
Covean3-Nov-09 4:07 
GeneralRe: Issue Launching UI Application from windows service in c# Windows Pin
platso_5883-Nov-09 20:16
platso_5883-Nov-09 20:16 
GeneralRe: Issue Launching UI Application from windows service in c# Windows Pin
Covean3-Nov-09 22:03
Covean3-Nov-09 22:03 
GeneralRe: Issue Launching UI Application from windows service in c# Windows Pin
platso_5884-Nov-09 4:09
platso_5884-Nov-09 4:09 

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.