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

C#

 
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 
AnswerRe: C# default interface method? Pin
PIEBALDconsult3-Nov-09 7:40
mvePIEBALDconsult3-Nov-09 7:40 
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 

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.