예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
        private void btnUserState_Click(object sender, EventArgs e)
        {
            userStateForm = new PubnubUserState();
            userStateForm.UserStateRequestSubmitted += new EventHandler(userStateForm_UserStateRequestSubmitted);
            userStateForm.Show();

        }
예제 #4
0
 private void btnUserState_Click(object sender, EventArgs e)
 {
     userStateForm = new PubnubUserState();
     userStateForm.UserStateRequestSubmitted += new EventHandler(userStateForm_UserStateRequestSubmitted);
     userStateForm.Show();
 }