N
Nicholas Beenham
Okie next problem:
I have 2 classes one of which fires an event to the other
public delegate void class1eventHandler (object sender, EventArgs e);
public class Class1
{
public event class1eventHandler class1Event;
protected virtual void OnChanged(EventArgs e)
{
if (class1event != null)
class1event(this, e);
}
public void onChange()
{
OnChanged(EventArgs.Empty);
}
}
public class Class2
{
public void addHandler()
{
class2Instance.class1event += new class1EventHandler(targetMethod);
}
public void targetEvent {}
My problem is that the class2Instance does not recognise the
class1event....any thoughts??
Thanks nick
I have 2 classes one of which fires an event to the other
public delegate void class1eventHandler (object sender, EventArgs e);
public class Class1
{
public event class1eventHandler class1Event;
protected virtual void OnChanged(EventArgs e)
{
if (class1event != null)
class1event(this, e);
}
public void onChange()
{
OnChanged(EventArgs.Empty);
}
}
public class Class2
{
public void addHandler()
{
class2Instance.class1event += new class1EventHandler(targetMethod);
}
public void targetEvent {}
My problem is that the class2Instance does not recognise the
class1event....any thoughts??
Thanks nick