hydrologics/Oasis.Base — Issue #31: Discussion Request: Might want an OasisEventBase that doesn't require IFormattable parameters
Author: slebherz
Created: 2011-12-09 22:27:44+00:00
State: open

I'd like to be able to have an event that looks like this:

```csharp
public class OpenThisItemInAnotherWindowEvent : OasisEventBase>
{
public OpenThisItemInAnotherWindowEvent(IAmARunViewer runViewer, IList runElements) :
base(runViewer, runElements, System.Diagnostics.TraceEventType.Information) { }
}
```

but the problem is that the IList isn't IFormattable, which is required of the type parameters to OasisEventBase. Here is Visual Studio saying the same:

The type 'System.Collections.Generic.IList' cannot be used as type parameter 'T2' in the generic type or method 'Oasis.Foundation.Events.OasisEventBase'. There is no implicit reference conversion from 'System.Collections.Generic.IList' to 'System.IFormattable'.

So, I think that I can make the event generic and say that the event parameter is IList where T : IFormattable. But then I've got this generic event that I don't really want to be generic.

What if we make an OasisEventBase that doesn't require T1 and T2 to implement IFormattable? I guess we would lose the event logging for those events (maybe we could call it OasisNoLogEventBase). Any thoughts on this? How bad would it be to lose the logging on some events? Are there any other complications?