Convert from one delegate to another. Pseudo cast

Viewed 1558

We are using IoC and have our logging exposed with it. We are using Common.Logging and I have written a matching delegate for Common.Logging.FormatMessageHandler but I do not know how to convert from our version of that delegate to the one that the Common.Logging api is expecting.

This question appears to be similar but I do not understand how to convert from my implemented type to the known type that I want to call. Dynamically casting one type of delegate to another

Here is my delegate signature:

public delegate string FormatMessageHandler(string format, params object[] args)

Here is Common.Logging's:

public delegate string FormatMessageHandler(string format, params object[] args)

Same name (not that is matters) and same number of parameters. Both are known at compile time so it should be something obvious but I am not seeing it.

2 Answers
Related