Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Issue Launching UI Application from windows service in c# Windows Pin
Covean4-Nov-09 5:19
Covean4-Nov-09 5:19 
QuestionPerformance Counter Instance Volatility Issues Pin
Last Attacker3-Nov-09 3:05
Last Attacker3-Nov-09 3:05 
Questionbasic understanding in c# threading. Pin
tomerb153-Nov-09 2:18
tomerb153-Nov-09 2:18 
AnswerRe: basic understanding in c# threading. PinPopular
Luc Pattyn3-Nov-09 2:24
sitebuilderLuc Pattyn3-Nov-09 2:24 
GeneralRe: basic understanding in c# threading. Pin
tomerb153-Nov-09 2:35
tomerb153-Nov-09 2:35 
GeneralRe: basic understanding in c# threading. Pin
Luc Pattyn3-Nov-09 4:36
sitebuilderLuc Pattyn3-Nov-09 4:36 
AnswerRe: basic understanding in c# threading. Pin
LimitedAtonement3-Nov-09 6:11
LimitedAtonement3-Nov-09 6:11 
QuestionExcel Chart(2007) data selection from c# Pin
leshu3-Nov-09 2:08
leshu3-Nov-09 2:08 
QuestionHow to Insert Data into database with SingleFunction in C# Pin
Phaneendra Varanasi3-Nov-09 1:36
Phaneendra Varanasi3-Nov-09 1:36 
AnswerRe: How to Insert Data into database with SingleFunction in C# Pin
dan!sh 3-Nov-09 1:42
professional dan!sh 3-Nov-09 1:42 
AnswerRe: How to Insert Data into database with SingleFunction in C# Pin
Md. Marufuzzaman3-Nov-09 3:24
professionalMd. Marufuzzaman3-Nov-09 3:24 

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.