Beispiel #1
0
        public void RemoveChannelFromChannelGroup()
        {
            var dialog = new AddRemoveFromChannelGroupDialogFragment(CommonDialogStates.RemoveFromChannelGroup, this);

            dialog.AddRemoveFromCgPerms += HandleAddRemoveFromCgPerms;
            dialog.Show(SupportFragmentManager, "dialog");
        }
Beispiel #2
0
 void HandleAddRemoveFromCgPerms(object sender, EventArgs ea)
 {
     try {
         AddRemoveFromCgEventArgs cea = ea as AddRemoveFromCgEventArgs;
         if (cea.cds == CommonDialogStates.AddToChannelGroup)
         {
             Display("Running AddChannelsToChannelGroup");
             ThreadPool.QueueUserWorkItem(o =>
                                          pubnub.AddChannelsToChannelGroup <string> (new string[] { cea.channel }, cea.channelGroup, DisplayReturnMessage, DisplayErrorMessage)
                                          );
         }
         else if (cea.cds == CommonDialogStates.RemoveFromChannelGroup)
         {
             Display("Running RemoveChannelsFromChannelGroup");
             ThreadPool.QueueUserWorkItem(o =>
                                          pubnub.RemoveChannelsFromChannelGroup <string> (new string[] { cea.channel }, cea.channelGroup, DisplayReturnMessage, DisplayErrorMessage)
                                          );
         }
         else if (cea.cds == CommonDialogStates.GetChannelGroup)
         {
             Display("Running GetChannelsForChannelGroup");
             ThreadPool.QueueUserWorkItem(o =>
                                          pubnub.GetChannelsForChannelGroup <string> (cea.channelGroup, DisplayReturnMessage, DisplayErrorMessage)
                                          );
         }
     }
     catch (Exception ex) {
         Display(ex.Message);
     } finally {
         AddRemoveFromChannelGroupDialogFragment coroutine = sender as AddRemoveFromChannelGroupDialogFragment;
         coroutine.AddRemoveFromCgPerms -= HandleAddRemoveFromCgPerms;
     }
 }
Beispiel #3
0
 void HandleAddRemoveFromCgPerms(object sender, EventArgs ea)
 {
     try {
         AddRemoveFromCgEventArgs cea = ea as AddRemoveFromCgEventArgs;
         if (cea.cds == CommonDialogStates.AddToChannelGroup)
         {
             Display("Running AddChannelsToChannelGroup");
             ThreadPool.QueueUserWorkItem(o =>
                                          pubnub.AddChannelsToChannelGroup().Channels(new [] { cea.channel })
                                          .ChannelGroup(cea.channelGroup)
                                          .Async(new DemoChannelGroupAddChannel(Display))
                                          );
         }
         else if (cea.cds == CommonDialogStates.RemoveFromChannelGroup)
         {
             Display("Running RemoveChannelsFromChannelGroup");
             ThreadPool.QueueUserWorkItem(o =>
                                          pubnub.RemoveChannelsFromChannelGroup()
                                          .Channels(new [] { cea.channel })
                                          .ChannelGroup(cea.channelGroup)
                                          .Async(new DemoChannelGroupRemoveChannel(Display))
                                          );
         }
         else if (cea.cds == CommonDialogStates.GetChannelGroup)
         {
             Display("Running GetChannelsForChannelGroup");
             ThreadPool.QueueUserWorkItem(o =>
                                          pubnub.ListChannelsForChannelGroup()
                                          .ChannelGroup(cea.channelGroup)
                                          .Async(new DemoChannelGroupAllChannels(Display))
                                          );
         }
     }
     catch (Exception ex) {
         Display(ex.Message);
     } finally {
         AddRemoveFromChannelGroupDialogFragment coroutine = sender as AddRemoveFromChannelGroupDialogFragment;
         coroutine.AddRemoveFromCgPerms -= HandleAddRemoveFromCgPerms;
     }
 }
Beispiel #4
0
 public void RemoveChannelFromChannelGroup()
 {
     var dialog = new AddRemoveFromChannelGroupDialogFragment (CommonDialogStates.RemoveFromChannelGroup, this);
     dialog.AddRemoveFromCgPerms += HandleAddRemoveFromCgPerms;
     dialog.Show (SupportFragmentManager, "dialog");
 }