I have an event handler in a class SpoServer named HandleSpurtEvents
public class SpoServer : DataModelObject, ISpoServer
{
static private void HandleSpurtEvents(SPD.SPD_eventType type, SPD.SPD_event this_event, object passback)
{
if (this_event.variableData[0].atr_value == "refresh")
{
if (this_event.variableData[1].atr_value == "complete")
{
ss.OnInfoEvent(new InfoEventArgs(SpoServer.InfoEventArgs.InfoType.RefreshComplete, null));
}
else
{
SpoDebug.DebugTraceSevere(func, "Invalid refresh event: " + this_event.variableData[1].atr_value);
}
}
}
public bool Modify()
{
}
}
Here the method Modify, which contain some opertaion what my aim is only allow downside
operation in Modify() method if ‘RuntimeUp’ property and Refresh complete.So what i did is i created flag ‘test’ after refresh event and checked with alredy created RuntimeUp.But it throwing errors.test boolean variable is not accessble
That will be something like,here is my work
public class SpoServer : DataModelObject, ISpoServer
{
static private void HandleSpurtEvents(SPD.SPD_eventType type, SPD.SPD_event this_event, object passback)
{
if (this_event.variableData[0].atr_value == "refresh")
{
if (this_event.variableData[1].atr_value == "complete")
{
ss.OnInfoEvent(new InfoEventArgs(SpoServer.InfoEventArgs.InfoType.RefreshComplete, null));
bool test = true;
}
else
{
SpoDebug.DebugTraceSevere(func, "Invalid refresh event: " + this_event.variableData[1].atr_value);
}
}
}
public bool Modify()
{
if (!RuntimeUp && test) return false;
}
}
testis a method variable (inHandleSpurtEvents) – it only makes sense in the context of that method. If you want it to be an object level variable (field), then relocate it:and don’t declare it in
HandleSpurtEvents– just assign it: