private void UpdateOneBone(string lineValue) { if (this.listBox1.InvokeRequired) { var d = new WindowsFormsControlLibrary.Threading.SafeCallDelegateUpdateBoneByString(UpdateOneBone); this.Invoke(d, new object[] { lineValue }); } else { //string BoneName = Bone.GetBoneName(lineValue); //List<Bone> arrayBone= this.listBox1.Items.Cast<Bone>().ToList(); //Bone bone = arrayBone.FirstOrDefault<Bone>(p => p.BoneName == BoneName); //if (bone != null) //{ // if (bone.IsNeedUpdate(lineValue)) { // bone.Update(lineValue); // int index = this.listBox1.Items.IndexOf(bone); // //this.listBox1.BeginUpdate(); // this.listBox1.Items.RemoveAt(index); // this.listBox1.Items.Insert(index, bone); // } // //this.listBox1.EndUpdate(); //} EAction eAction; Bone bone = Bone.GetBoneByString(lineValue, out eAction); if (bone != null) { UpdateOneBone(bone, eAction); } } }