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; }
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; }
private void btnPush_Click(object sender, EventArgs e) { pushForm = new PubnubPush(); pushForm.PushRequestSubmitted += new EventHandler(pushForm_PushRequestSubmitted); pushForm.Show(); }