/// <summary> /// 更新命令行 /// </summary> /// <param name="cmdLine"></param> private void update(int index, CmdLine cmdLine) { cmdLine = cmdLine.Clone() as CmdLine; commandsModule.RemoveCmdLineAt(index); commandsModule.InsertCmdLine(index, cmdLine); listView1.BeginUpdate(); var item = createItem(cmdLine); item.Selected = true; listView1.Items[index] = item; resizeCmdColumnWidth(); listView1.EndUpdate(); }