public HexBufferImpl(HexBufferStream stream, HexTags tags, bool disposeStream) : base(tags) { this.stream = stream ?? throw new ArgumentNullException(nameof(stream)); this.disposeStream = disposeStream; currentHexVersion = new HexVersionImpl(this, 0, 0); }
public HexVersionImpl SetChanges(IList<HexChange> changes, int? reiteratedVersionNumber = null) { var normalizedChanges = NormalizedHexChangeCollection.Create(changes); if (reiteratedVersionNumber == null) reiteratedVersionNumber = changes.Count == 0 ? ReiteratedVersionNumber : VersionNumber + 1; var newVersion = new HexVersionImpl(Buffer, VersionNumber + 1, reiteratedVersionNumber.Value); this.changes = normalizedChanges; next = newVersion; return newVersion; }
public HexVersionImpl SetChanges(IList <HexChange> changes, int?reiteratedVersionNumber = null) { var normalizedChanges = NormalizedHexChangeCollection.Create(changes); if (reiteratedVersionNumber is null) { reiteratedVersionNumber = changes.Count == 0 ? ReiteratedVersionNumber : VersionNumber + 1; } var newVersion = new HexVersionImpl(Buffer, VersionNumber + 1, reiteratedVersionNumber.Value); this.changes = normalizedChanges; next = newVersion; return(newVersion); }
void CreateNewVersion(IList <HexChange> changes, int?reiteratedVersionNumber = null) => currentHexVersion = currentHexVersion.SetChanges(changes, reiteratedVersionNumber);