I would like to know how to pass object array (object[]) between classes with the code bellow, which now sends string only:
public delegate void MessageDelegate(Object sender, MessageEventArgs e);
public class MessageEventArgs : EventArgs
{
public string Message;
public MessageEventArgs(string msg)
{
this.Message = msg;
}
}
public interface IController
{
event MessageDelegate ControllerEvent;
void InvokeControllerEvent(string msg);
}
public class Controller : IController
{
public event MessageDelegate ControllerEvent;
public void InvokeControllerEvent(string msg)
{
this.OnControllerEvent(new MessageEventArgs(msg));
}
protected virtual void OnControllerEvent(MessageEventArgs mea)
{
if (this.ControllerEvent != null)
{
this.ControllerEvent.Invoke(this, mea);
}
}
}