private void m_pTabGateways_Gateways_DoubleClick(object sender, EventArgs e)
        {
            if (m_pTabGateways_Gateways.SelectedItems.Count > 0)
            {
                SIP_Gateway gw = (SIP_Gateway)m_pTabGateways_Gateways.SelectedItems[0].Tag;
                wfrm_System_Services_SIP_Gateway frm = new wfrm_System_Services_SIP_Gateway(
                    gw.UriScheme,
                    gw.Transport,
                    gw.Host,
                    gw.Port,
                    gw.Realm,
                    gw.UserName,
                    gw.Password
                    );
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    gw.UriScheme = frm.UriScheme;
                    gw.Transport = frm.Transport;
                    gw.Host      = frm.Host;
                    gw.Port      = frm.Port;
                    gw.Realm     = frm.Realm;
                    gw.UserName  = frm.UserName;
                    gw.Password  = frm.Password;

                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.UriScheme;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Transport;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Host;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Port.ToString();
                }
            }
        }
Example #2
0
        private void m_pTabGateways_Gateways_DoubleClick(object sender,EventArgs e)
        {
            if(m_pTabGateways_Gateways.SelectedItems.Count > 0){
                SIP_Gateway gw = (SIP_Gateway)m_pTabGateways_Gateways.SelectedItems[0].Tag;
                wfrm_System_Services_SIP_Gateway frm = new wfrm_System_Services_SIP_Gateway(
                    gw.UriScheme,
                    gw.Transport,
                    gw.Host,
                    gw.Port,
                    gw.Realm,
                    gw.UserName,
                    gw.Password
                );
                if(frm.ShowDialog(this) == DialogResult.OK){
                    gw.UriScheme = frm.UriScheme;
                    gw.Transport = frm.Transport;
                    gw.Host      = frm.Host;
                    gw.Port      = frm.Port;
                    gw.Realm     = frm.Realm;
                    gw.UserName  = frm.UserName;
                    gw.Password  = frm.Password;

                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.UriScheme;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Transport;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Host;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Port.ToString();
                }
            }
        }
        private void m_pTabGateways_GatewaysToolbar_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.Tag.ToString() == "add")
            {
                wfrm_System_Services_SIP_Gateway frm = new wfrm_System_Services_SIP_Gateway();
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    SIP_Gateway gateway = m_pVirtualServer.SystemSettings.SIP.Gateways.Add(
                        frm.UriScheme,
                        frm.Transport,
                        frm.Host,
                        frm.Port,
                        frm.Realm,
                        frm.UserName,
                        frm.Password
                        );

                    ListViewItem item = new ListViewItem(frm.UriScheme);
                    item.SubItems.Add(frm.Transport);
                    item.SubItems.Add(frm.Host);
                    item.SubItems.Add(frm.Port.ToString());
                    item.Tag = gateway;
                    m_pTabGateways_Gateways.Items.Add(item);
                }
            }
            else if (e.ClickedItem.Tag.ToString() == "edit")
            {
                SIP_Gateway gw = (SIP_Gateway)m_pTabGateways_Gateways.SelectedItems[0].Tag;
                wfrm_System_Services_SIP_Gateway frm = new wfrm_System_Services_SIP_Gateway(
                    gw.UriScheme,
                    gw.Transport,
                    gw.Host,
                    gw.Port,
                    gw.Realm,
                    gw.UserName,
                    gw.Password
                    );
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    gw.UriScheme = frm.UriScheme;
                    gw.Transport = frm.Transport;
                    gw.Host      = frm.Host;
                    gw.Port      = frm.Port;
                    gw.Realm     = frm.Realm;
                    gw.UserName  = frm.UserName;
                    gw.Password  = frm.Password;

                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.UriScheme;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Transport;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Host;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Port.ToString();
                }
            }
            else if (e.ClickedItem.Tag.ToString() == "delete")
            {
                SIP_Gateway gw = (SIP_Gateway)m_pTabGateways_Gateways.SelectedItems[0].Tag;
                if (MessageBox.Show(this, "Are you sure you want to remove SIP selected gateway ?", "Remove Gateway", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    gw.Remove();
                    m_pTabGateways_Gateways.SelectedItems[0].Remove();
                }
            }
        }
Example #4
0
        private void m_pTabGateways_GatewaysToolbar_ItemClicked(object sender,ToolStripItemClickedEventArgs e)
        {
            if(e.ClickedItem.Tag.ToString() == "add"){
                wfrm_System_Services_SIP_Gateway frm = new wfrm_System_Services_SIP_Gateway();
                if(frm.ShowDialog(this) == DialogResult.OK){
                    SIP_Gateway gateway = m_pVirtualServer.SystemSettings.SIP.Gateways.Add(
                        frm.UriScheme,
                        frm.Transport,
                        frm.Host,
                        frm.Port,
                        frm.Realm,
                        frm.UserName,
                        frm.Password
                    );

                    ListViewItem item = new ListViewItem(frm.UriScheme);
                    item.SubItems.Add(frm.Transport);
                    item.SubItems.Add(frm.Host);
                    item.SubItems.Add(frm.Port.ToString());
                    item.Tag = gateway;
                    m_pTabGateways_Gateways.Items.Add(item);
                }
            }
            else if(e.ClickedItem.Tag.ToString() == "edit"){
                SIP_Gateway gw = (SIP_Gateway)m_pTabGateways_Gateways.SelectedItems[0].Tag;
                wfrm_System_Services_SIP_Gateway frm = new wfrm_System_Services_SIP_Gateway(
                    gw.UriScheme,
                    gw.Transport,
                    gw.Host,
                    gw.Port,
                    gw.Realm,
                    gw.UserName,
                    gw.Password
                );
                if(frm.ShowDialog(this) == DialogResult.OK){
                    gw.UriScheme = frm.UriScheme;
                    gw.Transport = frm.Transport;
                    gw.Host      = frm.Host;
                    gw.Port      = frm.Port;
                    gw.Realm     = frm.Realm;
                    gw.UserName  = frm.UserName;
                    gw.Password  = frm.Password;

                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.UriScheme;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Transport;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Host;
                    m_pTabGateways_Gateways.SelectedItems[0].SubItems[0].Text = frm.Port.ToString();
                }
            }
            else if(e.ClickedItem.Tag.ToString() == "delete"){
                SIP_Gateway gw = (SIP_Gateway)m_pTabGateways_Gateways.SelectedItems[0].Tag;
                if(MessageBox.Show(this,"Are you sure you want to remove SIP selected gateway ?","Remove Gateway",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){                
                    gw.Remove();
                    m_pTabGateways_Gateways.SelectedItems[0].Remove();
                }
            }
        }