Beispiel #1
0
        void pushForm_PushRequestSubmitted(object sender, EventArgs e)
        {
            string channelName = pushForm.ChannelName;
            string pushToken   = pushForm.PushToken;

            switch (pushForm.PushTypeRequest)
            {
            case "RegisterDevice":
                UpdateListBoxForDisplay("Running RegisterDeviceForPush()");
                pubnub.RegisterDeviceForPush <string>(channelName, PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                break;

            case "UnregisterDevice":
                UpdateListBoxForDisplay("Running UnregisterDeviceForPush()");
                pubnub.UnregisterDeviceForPush <string>(PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                break;

            case "RemoveChannel":
                UpdateListBoxForDisplay("Running RegisterDeviceForPush()");
                pubnub.RemoveChannelForDevicePush <string>(channelName, PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                break;

            case "GetChannels":
                UpdateListBoxForDisplay("Running RegisterDeviceForPush()");
                pubnub.GetChannelsForDevicePush <string>(PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                break;
            }
            pushForm = null;
        }
Beispiel #2
0
        void pushForm_PushRequestSubmitted(object sender, EventArgs e)
        {
            string channelName = pushForm.ChannelName;
            string pushToken = pushForm.PushToken;

            switch (pushForm.PushTypeRequest)
            {
                case "RegisterDevice":
                    UpdateListBoxForDisplay("Running RegisterDeviceForPush()");
                    pubnub.RegisterDeviceForPush<string>(channelName, PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                    break;
                case "UnregisterDevice":
                    UpdateListBoxForDisplay("Running UnregisterDeviceForPush()");
                    pubnub.UnregisterDeviceForPush<string>(PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                    break;
                case "RemoveChannel":
                    UpdateListBoxForDisplay("Running RegisterDeviceForPush()");
                    pubnub.RemoveChannelForDevicePush<string>(channelName, PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                    break;
                case "GetChannels":
                    UpdateListBoxForDisplay("Running RegisterDeviceForPush()");
                    pubnub.GetChannelsForDevicePush<string>(PushTypeService.MPNS, pushToken, DisplayReturnMessage, DisplayErrorMessage);
                    break;
            }
            pushForm = null;
        }
Beispiel #3
0
        private void btnPush_Click(object sender, EventArgs e)
        {
            pushForm = new PubnubPush();
            pushForm.PushRequestSubmitted += new EventHandler(pushForm_PushRequestSubmitted);
            pushForm.Show();

        }
Beispiel #4
0
 private void btnPush_Click(object sender, EventArgs e)
 {
     pushForm = new PubnubPush();
     pushForm.PushRequestSubmitted += new EventHandler(pushForm_PushRequestSubmitted);
     pushForm.Show();
 }