Exemplo n.º 1
0
        private void Publish_Click(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Running publish()");

            PublishMessageDialog view = new PublishMessageDialog();

            view.Show();

            view.Closed += (obj, args) =>
            {
                if (view.DialogResult == true)
                {
                    string publishMsg = view.Message.Text;
                    pubnub.publish <string>(channel, publishMsg, DisplayReturnMessage);
                }
            };
        }
Exemplo n.º 2
0
        public CodeExampleView()
        {
            InitializeComponent();

            Console.Container = ConsoleContainer;

            MessageBoxResult result = MessageBox.Show("Enable SSL?", "Settings", MessageBoxButton.OKCancel);

            if (result == MessageBoxResult.OK)
            {
                enableSSL = true;
                Console.WriteLine("SSL Enabled");
            }
            else
            {
                Console.WriteLine("SSL NOT Enabled");
            }

            MessageBoxResult cipherKeyView = MessageBox.Show("Do you want enter cipher key for encryption feature?", "Settings", MessageBoxButton.OKCancel);

            if (cipherKeyView == MessageBoxResult.OK)
            {
                PublishMessageDialog view = new PublishMessageDialog();

                view.Show();

                view.Closed += (obj, args) =>
                {
                    if (view.DialogResult == true)
                    {
                        cipheryKey = view.Message.Text;
                        Console.WriteLine("Cipher key provided.");
                    }
                };
            }
            else
            {
                Console.WriteLine("No Cipher key provided.");
                cipheryKey = string.Empty;
            }

            pubnub = new Pubnub("demo", "demo", "", cipheryKey, enableSSL);
        }
Exemplo n.º 3
0
        public CodeExampleView()
        {
            InitializeComponent();

            Console.Container = ConsoleContainer;

            MessageBoxResult result = MessageBox.Show("Enable SSL?", "Settings", MessageBoxButton.OKCancel);
            if (result == MessageBoxResult.OK)
            {
                enableSSL = true;
                Console.WriteLine("SSL Enabled");
            }
            else
            {
                Console.WriteLine("SSL NOT Enabled");
            }

            MessageBoxResult cipherKeyView = MessageBox.Show("Do you want enter cipher key for encryption feature?", "Settings", MessageBoxButton.OKCancel);
            if (cipherKeyView == MessageBoxResult.OK)
            {
                PublishMessageDialog view = new PublishMessageDialog();

                view.Show();

                view.Closed += (obj, args) =>
                {
                    if (view.DialogResult == true)
                    {
                        cipheryKey = view.Message.Text;
                        Console.WriteLine("Cipher key provided.");
                    }
                };
            }
            else
            {
                Console.WriteLine("No Cipher key provided.");
                cipheryKey = string.Empty;
            }

            pubnub = new Pubnub("demo", "demo", "", cipheryKey, enableSSL);

        }
Exemplo n.º 4
0
        private void Publish_Click(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Running publish()");

            PublishMessageDialog view = new PublishMessageDialog();

            view.Show();

            view.Closed += (obj, args) => 
            {
                if (view.DialogResult == true)
                {
                    string publishMsg = view.Message.Text;
                    pubnub.publish<string>(channel, publishMsg, DisplayReturnMessage);
                }
            };
        }