/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="beforeVersion">Version before the change</param>
		/// <param name="afterVersion">Version after the change</param>
		/// <param name="editTag">Edit tag</param>
		protected HexVersionChangedEventArgs(HexVersion beforeVersion, HexVersion afterVersion, object editTag) {
			if (beforeVersion == null)
				throw new ArgumentNullException(nameof(beforeVersion));
			if (afterVersion == null)
				throw new ArgumentNullException(nameof(afterVersion));
			BeforeVersion = beforeVersion;
			AfterVersion = afterVersion;
			EditTag = editTag;
		}
Example #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;
		}
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="beforeVersion">Version before the change</param>
 /// <param name="afterVersion">Version after the change</param>
 /// <param name="editTag">Edit tag</param>
 protected HexVersionChangedEventArgs(HexVersion beforeVersion, HexVersion afterVersion, object editTag)
 {
     BeforeVersion = beforeVersion ?? throw new ArgumentNullException(nameof(beforeVersion));
     AfterVersion  = afterVersion ?? throw new ArgumentNullException(nameof(afterVersion));
     EditTag       = editTag;
 }
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="beforeVersion">Version before the change</param>
		/// <param name="editTag">Edit tag</param>
		/// <param name="cancelAction">Called when <see cref="Cancel"/> gets called</param>
		public HexContentChangingEventArgs(HexVersion beforeVersion, object editTag, Action<HexContentChangingEventArgs> cancelAction) {
			BeforeVersion = beforeVersion;
			EditTag = editTag;
			this.cancelAction = cancelAction;
		}
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="beforeVersion">Version before the change</param>
 /// <param name="editTag">Edit tag</param>
 /// <param name="cancelAction">Called when <see cref="Cancel"/> gets called</param>
 public HexContentChangingEventArgs(HexVersion beforeVersion, object editTag, Action <HexContentChangingEventArgs> cancelAction)
 {
     BeforeVersion     = beforeVersion;
     EditTag           = editTag;
     this.cancelAction = cancelAction;
 }