Skip to content

Instantly share code, notes, and snippets.

@chris-garrett
Created August 26, 2014 17:25
Show Gist options
  • Save chris-garrett/be4708568b45c137d935 to your computer and use it in GitHub Desktop.
Save chris-garrett/be4708568b45c137d935 to your computer and use it in GitHub Desktop.
Adding a command.
// In javascript
var params = {
"ViewName" : "MyView",
"Interacting" : true
};
pureweb.getClient().queueCommand('SetInteracting', params, function (sender, args) {
});
// 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