示例#1
0
 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);
 }
示例#2
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;
		}
示例#3
0
        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);
        }
示例#4
0
 void CreateNewVersion(IList <HexChange> changes, int?reiteratedVersionNumber = null) =>
 currentHexVersion = currentHexVersion.SetChanges(changes, reiteratedVersionNumber);