Hi,
I'm not sure of the terminology here but...
I have a standalone assembly (Foo) and I log errors using a simple call
in my "catch" blocks: e.g.
class Foo
....
public DoSomething()
{
....
catch
{
LogError("blah", Severity.Error, etc....);
}
....
void LogError(msg,sev,...) { output.write(...) }
....
This assembly DLL will be referenced by other assemblies however each
of these calling assemblies may wish to log any errors their own way.
Can I make it so that the calling assembly somehow "overrides" the
LogError calls and writes the errors however it wishes. Ideally I'd
like:
using Foo
class Bar
....
Foo.DoSomething()
....
void LogError(msg) { showpopup(msg) } <--(I want THIS LogError to run
when DoSomething goes wrong)
I'm looking at interfaces, abstract classes, virtual functions, etc.
but I'm not inherting anything here - just making calls to an assembly.
Hope someone can help.
Thanks.