hello everyone in a class i have some properties. 4 of them are static props. fifth of them is not public and in set method of the fifth one i want to fire an event. and parameters of the event the other four props. event code in the set method is like this;
if(value= =true) // if the property gets the true event will be fired
{
if(event!=null)
{
event(1 static prop,2 statik prop.. 4 statik prop)
}
}
i assigned the value of true in c#. i use breakpoint in c# to debug. when te term comes to code
event(1 static prop,2 statik prop.. 4 statik prop) i control the properties values thy are right but whn firing i get error "object reference not to set instance of an object". in the event parameters i use public variables of properties. and if i write "if (evnt!=null)" if block doesnt work but if i write if(event==null) this block works.
can anyone help please
Loading
nkayPosted Aug 23, 2007, 2:40 AM
in page load event class.event +=new class.delegate(method);
void method() {......}
but i cannot cath :(
in short, i want to use events in a class library project, fire them in winapp project, and cacth thm from asp.net project. or again using event project and to fire events from asp project and catcth them in winapp project.
really thanks friends fro your ideas and help
Alistair ThrussellPosted Aug 22, 2007, 7:38 AM
someClass
{
public delegate void someEvent (String Parameter);
public event someEvent SomeEvent_SomeThingHappended;
public void MethodThatRaisesEvent()
{
someEvent(SomeParameter);
}
}
AlanPosted Aug 22, 2007, 6:51 AM
Are you sure that you've assigned a new instance of the appropriate delegate type to your 'event' variable? If you haven't then it will always be null.