NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error CS0068

'event': event in interface cannot have initializer

An event in an interface cannot have an initializer.

The following sample generates CS0068:

delegate void MyDelegate();
interface I {
   event MyDelegate d = new MyDelegate(M.f);   // CS0068
   // try the following line instead
   // event MyDelegate d2;
}

class M {
   event MyDelegate d = new MyDelegate(M.f);

   public static void f() {
   }

   public static void Main() {
   }
}