I have a method Modify which doing a operation ClientModify inside.
public bool Modify()
{
bool retval = false;
retval = Spa.ClientModify(col);
}
Here what i wanted is the ClientModify should perform only after three events completed in the eventhandler “ServerEvents” otherwise it should return(retval ) false .How can i do that checks on “Spa.ClientModify”
static private void ServerEvents(eventType type, event this_event, object passback)
{
if (this_event.type == eventType.SPD_spurtEvent)
{
if (this_event.objectName == "ready")
{
// some operation
}
else if (this_event.objectName == "info")
{
// some operation
}
else if (this_event.objectName == "serverstate")
{
// some operation
}
}
}
So what i did is
public class Server : ModelObject, IServer
{
public class MyState
{
public bool Method1HasExecuted { get; set; }
public bool Method2HasExecuted { get; set; }
public bool Method3HasExecuted { get; set; }
}
}
static private void ServerEvents(eventType type, event this_event, object passback)
{
MyState s = new MyState();
each three operation i did check like this s.Method1HasExecuted = true; like this
}
and modify method i did this way
public bool Modify()
{
return MyClassState.Method1HasExecuted && MyClassState.Method2HasExecuted && MyClassState.Method3HasExecuted ? Spa.ClientModify() : false;
}
}
Then i am getting error Spo.Plugins.Server.MyState.Method1HasExecuted.get’ must declare a body because it is not marked abstract or extern,,IS there any other way
You’re using .net 2.0 so you can’t use the autoimplemented properties. You need to change the MyState class to be like this: