i have a else loop where two methods are executing,
static private void HandleClientStateCB(string clientName,
SPD.SPD_clientStateType state, object pb){
//IF()
else {
HandlePCAEvent(myDevice, SpoServer.PCA.Event.DeviceInactive, "");
HandlePCAEvent(myDevice, SpoServer.PCA.Event.DeviceDisconnect, "");
}
}
what my requirement was whenever client disconnected that time i need to make version to null.The existing condition is like this
static private void HandleClientEventCB(SPD.SPD_eventType type,
SPD.SPD_event this_event, object passback){
//------------------
string agentVersion = "0.0.0.0";
if (this_event.variableData.Length >= 6 ){
agentVersion = this_event.variableData[5].atr_value;
}
}
So what i did is i declared a boolean variable test private static bool test = false;
then i used in else loop
static private void HandleClientStateCB(string clientName,
SPD.SPD_clientStateType state, object pb){
//IF()
else {
HandlePCAEvent(myDevice, SpoServer.PCA.Event.DeviceInactive, "");
HandlePCAEvent(myDevice, SpoServer.PCA.Event.DeviceDisconnect, "");
test = true;
}
}
static private void HandleClientEventCB(SPD.SPD_eventType type,
SPD.SPD_event this_event, object passback){
//-------------------------------
string agentVersion = "0.0.0.0";
if (this_event.variableData.Length >= 6 && test==false ){
agentVersion = this_event.variableData[5].atr_value;
}
}
But this logic is not working,Can any body suggest any other logic so that disconnect time my version should be Null