private void RemoveUnneededObjectsFromProperty(ICmObject[] oldObjs, ICmObject[] objsChosen) { if (oldObjs.Length == 0) return; var i = 0; foreach (var oldObj in oldObjs) { if (!objsChosen.Contains(oldObj)) { RemoveFromPropertyAt(i, oldObj); i--; } i++; } }