Why cant i use the event declared in Base from Sub?
class Program
{
static void Main(string[] args)
{
Sub sub = new Sub();
sub.log += new Base.logEvent(sub_log);
sub.go();
}
static void sub_log(string message, int level)
{
Console.Out.WriteLine(message + " " + level);
}
}
public abstract class Base
{
public delegate void logEvent(String message, int level);
public event logEvent log;
}
public class Sub : Base
{
public void go()
{
log("Test", 1); // <-- this wont compile
}
}