Bear with my while I try to explain...
I've created these two interfaces:
public interface ILoggingEvents { event LoggingWindowClosing
OnClosing;}
public interface ILogging { ... }
I then created a class that implements them both:
public class WindowLogging : ILogging, ILoggingEvents
{ ... }
However, in my code I cannot access methods implemented for the
ILoggingEvent:
ILogging logger = new WindowLogging();
log.onMyEvent += ... <--- understandably this is not accessible
My thinking was to allow the logger implementation class to fire
events (if subscribed to) but I didnt want to require all
implementions of ILogger to have to implement the events. For example
a logger to a window might want to let known the window is closing but
a text file logger wouldnt need to do that. Hope that makes sense.
Obviously, my design isnt going to work without come changes. I could
just use an base class instead of an interface. My question is: is
it possible to somehow do this with interfaces? (btw, I chose to use
interfaces just so that I could have a chance to explore them).
Thanks
Matt