⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmphones.cs

📁 Gibphone is CSharp Program, it can tell you how to design p2p chat.
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GPCore.Vocoders;
using GPCore.NetworkProtocols;
using GPCore.Phones;

namespace GPCore.Forms
{
    /// <summary>
    /// A Form for showing the currently configured phones.
    /// </summary>
    public partial class frmPhones : Form
    {
        /// <summary>
        /// Creates a new frmPhones.
        /// </summary>
        public frmPhones()
        {
            InitializeComponent();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmNewPhone f = new frmNewPhone();
            if (f.ShowDialog() == DialogResult.OK)
            {
                string vox = f.lstVocoder.SelectedItems[0].Text;
                string nox = f.lstNetwork.SelectedItems[0].Text;
                string phone = f.lstPhone.SelectedItems[0].Text;
                Vocoder v = Core.CreateInstance(vox) as Vocoder;
                NetworkProtocol np = Core.CreateInstance(nox) as NetworkProtocol;
                Phone p = Core.CreateInstance(phone) as Phone;
                p.Initialize(v, np);
                ListViewItem li = listView1.Items.Add(phone);
                li.SubItems.Add(vox);
                li.SubItems.Add(nox);
            }
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            ListViewItem li = listView1.SelectedItems[0];

            listView1.Items.Remove(li);
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -