Ejemplo n.º 1
0
        private void subscribeToPubSubToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PubSubSubcribeForm ps = new PubSubSubcribeForm();

            // this is a small race.  to do it right, I should call dm.BeginFindServiceWithFeature,
            // and modify that to call back on all of the found services.  The idea is that
            // by the the time the user has a chance to click on the menu item, the DiscoManager
            // will be populated.
            ps.DiscoManager = dm;
            if (ps.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            JID    jid  = ps.JID;
            string node = ps.Node;
            string text = string.Format("{0}/{1}", jid, node);

            TabPage tp = new TabPage(text);

            tp.Name = text;

            PubSubDisplay disp = new PubSubDisplay();

            disp.Node = psm.GetNode(jid, node, 10);
            tp.Controls.Add(disp);
            disp.Dock = DockStyle.Fill;

            tabControl1.TabPages.Add(tp);
            tabControl1.SelectedTab = tp;
        }
Ejemplo n.º 2
0
        private void deletePubSubToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PubSubSubcribeForm fm = setupPubSubForm();

            if (fm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            JID    jid  = fm.JID;
            string node = fm.Node;

            psm.RemoveNode(jid, node,
                           delegate
            {
                MessageBox.Show("Remove Node unsuccessful.");
            });

            tabControl1.TabPages.RemoveByKey(string.Format("{0}/{1}", jid, node));
        }