コード例 #1
0
        private void HereNow_Click(object sender, RoutedEventArgs e)
        {
            CheckUserInputs();
            channel = txtChannel.Text;
            uuid    = txtUUID.Text;

            if (uuid.Trim() == "")
            {
                MessageBox.Show("UUID is required");
                return;
            }

            if (authKey.Trim() != "")
            {
                pubnub.AuthenticationKey = authKey;
            }

            HereNowOptionsDialog hereNowPopup = new HereNowOptionsDialog();

            hereNowPopup.Show();

            hereNowPopup.Closed += (obj, args) =>
            {
                if (hereNowPopup.DialogResult == true)
                {
                    Console.WriteLine("Running Here_Now()");

                    bool hereNowShowUUIDList = hereNowPopup.chkHereNowShowUUIDList.IsChecked.Value;
                    bool hereNowIncludeState = hereNowPopup.chkHereNowIncludeState.IsChecked.Value;

                    pubnub.HereNow <string>(channel, hereNowShowUUIDList, hereNowIncludeState, DisplayUserCallbackMessage, DisplayErrorMessage);
                }
            };
        }
コード例 #2
0
        private void HereNow_Click(object sender, RoutedEventArgs e)
        {
            CheckUserInputs();
            channel = txtChannel.Text;
            uuid = txtUUID.Text;

            if (uuid.Trim() == "")
            {
                MessageBox.Show("UUID is required");
                return;
            }

            if (authKey.Trim() != "")
            {
                pubnub.AuthenticationKey = authKey;
            }

            HereNowOptionsDialog hereNowPopup = new HereNowOptionsDialog();

            hereNowPopup.Show();

            hereNowPopup.Closed += (obj, args) =>
            {
                if (hereNowPopup.DialogResult == true)
                {
                    Console.WriteLine("Running Here_Now()");

                    bool hereNowShowUUIDList = hereNowPopup.chkHereNowShowUUIDList.IsChecked.Value;
                    bool hereNowIncludeState = hereNowPopup.chkHereNowIncludeState.IsChecked.Value;

                    pubnub.HereNow<string>(channel, hereNowShowUUIDList, hereNowIncludeState, DisplayUserCallbackMessage, DisplayErrorMessage);
                }
            };
        }