frmnewphone.cs

来自「Gibphone is CSharp Program, it can tell 」· CS 代码 · 共 85 行

CS
85
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GPCore.Forms
{
    /// <summary>
    /// A form for creating new Phone objects.
    /// </summary>
    public partial class frmNewPhone : Form
    {
        /// <summary>
        /// Creates a new NewPhone form.
        /// </summary>
        public frmNewPhone()
        {
            InitializeComponent();
        }

        private void frmNewPhone_Load(object sender, EventArgs e)
        {
            foreach (string s in Core.PluginManager.Phones)
            {
                object[] a = Core.PluginManager.GetAttributes(s);
                foreach (object o in a)
                {
                    if (o is PluginAttribute)
                    {
                        PluginAttribute pa = o as PluginAttribute;
                        ListViewItem li = lstPhone.Items.Add(pa.Title);
                        li.ToolTipText = String.Format("{0} Version {1}\n"+
                                                    "Developed by {2} of {3}\n"+
                                                    "{4}", pa.Title, pa.Version, pa.Developers, pa.Company, pa.Description);
                    }
                }
            }
            foreach (string s in Core.PluginManager.Vocoders)
            {
                object[] a = Core.PluginManager.GetAttributes(s);
                foreach (object o in a)
                {
                    if (o is PluginAttribute)
                    {
                        PluginAttribute pa = o as PluginAttribute;
                        ListViewItem li = lstVocoder.Items.Add(pa.Title);
                        li.ToolTipText = String.Format("{0} Version {1}\n" +
                                                    "Developed by {2} of {3}\n" +
                                                    "{4}", pa.Title, pa.Version, pa.Developers, pa.Company, pa.Description);
                    }
                }
            }
            foreach (string s in Core.PluginManager.NetworkProtocols)
            {
                object[] a = Core.PluginManager.GetAttributes(s);
                foreach (object o in a)
                {
                    if (o is PluginAttribute)
                    {
                        PluginAttribute pa = o as PluginAttribute;
                        ListViewItem li = lstNetwork.Items.Add(pa.Title);
                        li.ToolTipText = String.Format("{0} Version {1}\n" +
                                                    "Developed by {2} of {3}\n" +
                                                    "{4}", pa.Title, pa.Version, pa.Developers, pa.Company, pa.Description);
                    }
                }
            }
        }

        private void btnCreate_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}

⌨️ 快捷键说明

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