private static void AddAction(List <EditAction> currentSet, EditAction.ActionType type, string value) { EditAction newAction = new EditAction() { EditType = type, Value = value }; int length = currentSet.Count; if (length == 0) { currentSet.Add(newAction); } else { EditAction lastaction = currentSet[length - 1]; if (lastaction.EditType == newAction.EditType) { lastaction.Value += newAction.Value; } else { currentSet.Add(newAction); } } }
private void AddAction(List <EditAction <T> > currentSet, EditAction <T> .ActionType type, T value) { EditAction <T> newAction = new EditAction <T>(); newAction.EditType = type; newAction.Value.Add(value); int length = currentSet.Count; if (length == 0) { currentSet.Add(newAction); } else { EditAction <T> lastaction = currentSet[length - 1]; if (lastaction.EditType == newAction.EditType) { lastaction.Value.Add(value); } else { currentSet.Add(newAction); } } }