public EditedZoneCommand executeCommand(EditedZoneCommand run) { foreach (var item in run.mRemove) { int count = mSeries.Count; for (int i = 0; i < count; i++) { EditedZoneUnit item2 = mSeries[i]; if (item.mStart == item2.mStart && item.mEnd == item2.mEnd) { mSeries.RemoveAt(i); break; } } } foreach (var item in run.mAdd) { mSeries.Add((EditedZoneUnit)item.clone()); } mSeries.Sort(); return(new EditedZoneCommand(run.mRemove, run.mAdd)); }
public EditedZoneCommand add(EditedZoneUnit[] items) { EditedZoneCommand com = generateCommandAdd(items); return(executeCommand(com)); }
public EditedZoneCommand add(int start, int end) { EditedZoneCommand com = generateCommandAdd(start, end); return(executeCommand(com)); }