Created
August 26, 2014 17:25
-
-
Save chris-garrett/be4708568b45c137d935 to your computer and use it in GitHub Desktop.
Adding a command.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In javascript | |
var params = { | |
"ViewName" : "MyView", | |
"Interacting" : true | |
}; | |
pureweb.getClient().queueCommand('SetInteracting', params, function (sender, args) { | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In your C++ service register a command and the callback : | |
StateManager::Instance()->CommandManager().AddUiHandler("SetInteracting", Bind(this, &MyService::OnSetInteraction)); | |
void MyService::OnSetInteraction(CSI::Guid sessionId, CSI::Typeless command, CSI::Typeless& response) | |
{ | |
bool interacting = command["Interacting"].Value().As<bool>(); | |
String viewName = command["ViewName"].Value().As<String>(); | |
StateManager::Instance()->ViewManager().SetViewInteracting(viewName, interacting); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment