Hi,
I have Windows forms(UI Component) which has a lable and the message for the label from my bussiness component. I'm trying to do this by raising a Event with Data which will be captured in UI. Is this possible ? Below is the code which i have in business component.
namespace ...below classes are in one .cs file
{
public class UpdateEventArgs : EventArgs
{
public string msg;
}
public delegate void UpdateEventHandler(object sender, UpdateEventArgs e);
public class test
{
......
public event UpdateEventHandler Update;
UpdateEventArgs evegrs = new UpdateEventArgs();
protected virtual void onUpdate(UpdateEventArgs e)
{
if (update != null) //"update" is showing as Null , please tell me what am i missing
update(this, e);
}
public void SomeBussiness() //method called from UI Layer
{
evegrs.msg= "Hello World";
onUpdate(evegrs);
}
}
I'm working on .net 2.0, on a windows 2003 server.
Thanks
-Aaron
Start Free Trial