Esempio n. 1
0
        private void InitAllFrp()
        {
            List <FrpSettingModel> allFrp = FrpSettingAction.GetAllFrpSetting();

            foreach (FrpSettingModel item in allFrp)
            {
                FrpList.Add(new FrpModel(item));
            }
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            frpObj.AutoRun    = this.checkBox1.Checked;
            frpObj.Name       = this.textBox_name.Text;
            frpObj.ConfigFile = this.textBox_cf.Text;
            frpObj.LogFile    = this.textBox_lf.Text;

            if (isAdd)
            {
                FrpSettingAction.AddFrpSettingToConfig(frpObj);
                DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                FrpSettingAction.EditFrpSettingToConfig(frpObj);
                DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 删除配置按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button5_Click(object sender, EventArgs e)
        {
            if (this.listView1.SelectedItems.Count > 0)
            {
                ListViewItem select = this.listView1.SelectedItems[0];

                FrpModel frpobj = select.Tag as FrpModel;
                if (frpobj != null)
                {
                    string info = "确定要删除" + frpobj.Config.Name + "吗?删除时将关闭其当前正在运行的进程。";
                    if (MessageBox.Show(info, "警告", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
                    {
                        FrpSettingAction.DelFrpSettingFromConfig(frpobj.Config);
                        frpobj.Exit();
                        frpobj.ListItem = null;
                        this.listView1.Items.Remove(select);
                    }
                }
            }
        }