private void RefreshShellStatusInListView(ListViewItem item, string status) { //等待异步 if (this.InvokeRequired) { RefreshShellStatusInvoke invoke = new RefreshShellStatusInvoke(RefreshShellStatusInListView); this.Invoke(invoke, new object[] { item, status }); } else { item.SubItems[4].Text = status; Shell shell = (Shell)item.Tag; shell.Status = status; _shellManagerService.Update(int.Parse(shell.Id), shell); } }
private void button_Alter_Click(object sender, EventArgs e) { Shell shell = new Shell(); shell.Id = this.Id; shell.TargetId = this.textBox_TargetID.Text.Trim(); shell.TargetLevel = this.comboBox_TargetLevel.Text.Trim(); shell.ShellUrl = this.textBox_ShellPath.Text.Trim(); shell.ShellPwd = this.textBox_ShellPass.Text.Trim(); shell.ShellExtraString = this.richTextBox_Setting.Text.Trim(); shell.Remark = this.textBox_Remark.Text.Trim(); shell.ShellType = this.comboBox_ScritpType.Text.Trim(); shell.ServerCoding = this.comboBox_ServerCoding.Text.Trim(); shell.WebCoding = this.comboBox_WebCoding.Text.Trim(); shell.Area = this.comboBox_Area.Text.Trim(); string time = DateTime.Now.Date.ToShortDateString(); if (time.Contains("/")) { time = time.Replace("/", "-"); } shell.AddTime = time; //验证ExtraSettingXml是否合法 if (!VerifyXml(shell.ShellExtraString)) { return; } _shellManagerService.Update(int.Parse(shell.Id), shell); OnWebshellChange(EventArgs.Empty); this.Close(); }