void userStateForm_UserStateRequestSubmitted(object sender, EventArgs e) { string channelName = userStateForm.ChannelName; string channelGroupName = userStateForm.ChannelGroupName; switch (userStateForm.UserStateRequest) { case "GetUserState": pubnub.GetUserState <string>(channelName, channelGroupName, DisplayReturnMessage, DisplayErrorMessage); break; case "SetUserState": pubnub.SetUserState <string>(channelName, channelGroupName, new KeyValuePair <string, object>(userStateForm.StateKey, userStateForm.StateValue), DisplayReturnMessage, DisplayErrorMessage); break; } userStateForm = null; }
void userStateForm_UserStateRequestSubmitted(object sender, EventArgs e) { string channelName = userStateForm.ChannelName; string channelGroupName = userStateForm.ChannelGroupName; switch (userStateForm.UserStateRequest) { case "GetUserState": pubnub.GetUserState<string>(channelName, channelGroupName, DisplayReturnMessage, DisplayErrorMessage); break; case "SetUserState": pubnub.SetUserState<string>(channelName, channelGroupName, new KeyValuePair<string,object>(userStateForm.StateKey, userStateForm.StateValue), DisplayReturnMessage, DisplayErrorMessage); break; } userStateForm = null; }
private void btnUserState_Click(object sender, EventArgs e) { userStateForm = new PubnubUserState(); userStateForm.UserStateRequestSubmitted += new EventHandler(userStateForm_UserStateRequestSubmitted); userStateForm.Show(); }