private void ProcessDeferredSequenceNumberCommand() { if (_uidSet.IsTouched) { return; } var replacement = SearchCommands.Search + Characters.Space; var from = _sequenceNumberSet.Range.From; var to = _sequenceNumberSet.Range.To; var values = _sequenceNumberSet.Values; if (from < 0 && to < 0 && values.Count == 0) { return; } if (from > 0 || to > 0) { if (from < 0) { replacement += Characters.Asterisk; } else { var text = from.ToString(); replacement += text; } replacement += Characters.Colon; if (to < 0) { replacement += Characters.Asterisk; } else { var text = to.ToString(); replacement += text; } } else { replacement = values.Aggregate(replacement, (current, value) => current + (value.ToString() + Characters.Space)); } _writer.Replace(SearchCommands.Search, replacement); }