Click here to Skip to main content
15,907,395 members
Home / Discussions / C#
   

C#

 
AnswerRe: Accessing WCF Pin
jschell3-Nov-09 11:10
jschell3-Nov-09 11:10 
Questionconvert .mdf database file in text file Pin
Member 4876723-Nov-09 5:56
Member 4876723-Nov-09 5:56 
AnswerRe: convert .mdf database file in text file Pin
Saksida Bojan3-Nov-09 6:11
Saksida Bojan3-Nov-09 6:11 
GeneralRe: convert .mdf database file in text file Pin
Md. Marufuzzaman3-Nov-09 6:15
professionalMd. Marufuzzaman3-Nov-09 6:15 
GeneralRe: convert .mdf database file in text file Pin
Member 4876723-Nov-09 7:05
Member 4876723-Nov-09 7:05 
AnswerRe: convert .mdf database file in text file Pin
Md. Marufuzzaman3-Nov-09 6:11
professionalMd. Marufuzzaman3-Nov-09 6:11 
GeneralRe: convert .mdf database file in text file Pin
Member 4876723-Nov-09 7:29
Member 4876723-Nov-09 7:29 
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 
I'm trying to implement the idea of a default interface. Maybe this isn't possible, and if there's another manner in which I can implement this please let me know.
The reason for this is that I have an ErrorLog class that I'd like others to use while allowing them to customize the actual writing of the data (if they choose). I have written a default WriteLog method that will write some basic information to a general database table but it obviously won't apply in all cases, therefore I would like to provide the option to override this.

My code is similar to the following. I've left out some syntax and details, but it should be close enough to understand. Please ask for any clarification.

Both of these classes are in the same project:

ErrorLog.cs:
namespace Library {
    public interface IErrorLog {
        void WriteLog(ErrorLog el)
    }

    public class ErrorLog
    {
        public void Log() {
            WriteLog(this);
        }
    }
}


WriteLog.cs:
namespace Library {
    public class Write : IErrorLog {
        public void WriteLog(ErrorLog el) {
            // implementation
        }
    }
}


I'd like other applications/projects to implement the IErrorLog interface which would require them to create a WriteLog() method. If they'd like to use the default they can simply refer to the Write.WriteLog() method.
Something is off with my organization or implementation, though. It seems I can't include the WriteLog() "default" in the same project because when I add a reference to Library.ErrorLog in the other application it doesn't require me to implement WriteLog(). I suppose that's because it's already been defined in the project. Do I need to split these into two projects? If so, how do I reference the "default" method?

Thanks for any help since I've thoroughly confused myself.
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 

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.