G
Guest
Hello,
I want to execute a delegate (event) in tha base class from a derived class
but i get comile time error. Is there a work arround?
base class :
public abstract class Document
{
public event EventHandler OnDataChanged;
public virtual void SetData(string xmlString)
{
_data = xmlString;
this.IsDirty = true;
if (OnDataChanged != null)
{
OnDataChanged(this, new EventArgs());
}
}
derived class :
public class RuleXmlDocument : Document
{
void RaiseMyEvent(object sender, EventArgs e)
{
if (OnDataChanged != null)
{
OnDataChanged(sender, e);
}
}
----------------------------------------------------------------
Here what i want is when i call RaiseMyEvent() function the event should be
raised but. Its a compile time error. Some how base class delegate is
publically available but cannot be used as its used in the base class.
Any Guesses?
Thanx in advance
Ayyaz-
I want to execute a delegate (event) in tha base class from a derived class
but i get comile time error. Is there a work arround?
base class :
public abstract class Document
{
public event EventHandler OnDataChanged;
public virtual void SetData(string xmlString)
{
_data = xmlString;
this.IsDirty = true;
if (OnDataChanged != null)
{
OnDataChanged(this, new EventArgs());
}
}
derived class :
public class RuleXmlDocument : Document
{
void RaiseMyEvent(object sender, EventArgs e)
{
if (OnDataChanged != null)
{
OnDataChanged(sender, e);
}
}
----------------------------------------------------------------
Here what i want is when i call RaiseMyEvent() function the event should be
raised but. Its a compile time error. Some how base class delegate is
publically available but cannot be used as its used in the base class.
Any Guesses?
Thanx in advance
Ayyaz-