/// <summary> /// Allocates an object that describes an edit to a compilation as being either the addition, deletion or modification of a definition. /// </summary> /// <param name="kind">The kind of edit that has been performed (addition, deletion or modification).</param> /// <param name="affectedDefinition">The definition that has been added, deleted or modified.</param> /// <param name="modifiedParent">The new version of the parent of the affected definition (see also this.OriginalParent). /// If the edit is an addition or modification, this.ModifiedParent is the actual parent of this.AffectedDefinition. /// If this.AffectedDefinition does not have a parent then this.ModifiedParent is the same as this.AffectedDefinition.</param> /// <param name="originalParent">The original parent of the affected definition (see also this.ModifiedParent). /// If the edit is a deletion, this.OriginalParent is the parent of this.AffectedDefinition. /// If this.AffectedDefinition does not have a parent then this.OriginalParent is the same as this.AffectedDefinition.</param> /// <param name="modifiedSourceDocument">The source document that is the result of the edit described by this edit instance.</param> /// <param name="originalSourceDocument">The source document that has been edited as described by this edit instance.</param> public EditDescriptor(EditEventKind kind, IDefinition affectedDefinition, IDefinition modifiedParent, IDefinition originalParent, ISourceDocument modifiedSourceDocument, ISourceDocument originalSourceDocument) { Contract.Requires(affectedDefinition != null); Contract.Requires(modifiedParent != null); Contract.Requires(originalParent != null); Contract.Requires(modifiedSourceDocument != null); Contract.Requires(originalSourceDocument != null); Contract.Requires(modifiedSourceDocument.IsUpdatedVersionOf(originalSourceDocument)); this.kind = kind; this.affectedDefinition = affectedDefinition; this.modifiedSourceDocument = modifiedSourceDocument; this.modifiedParent = modifiedParent; this.originalSourceDocument = originalSourceDocument; this.originalParent = originalParent; }
/// <summary> /// Allocates an object that describes an edit to a compilation as being either the addition, deletion or modification of a definition. /// </summary> /// <param name="kind">The kind of edit that has been performed (addition, deletion or modification).</param> /// <param name="affectedDefinition">The definition that has been added, deleted or modified.</param> /// <param name="modifiedParent">The new version of the parent of the affected definition (see also this.OriginalParent). /// If the edit is an addition or modification, this.ModifiedParent is the actual parent of this.AffectedDefinition. /// If this.AffectedDefinition does not have a parent then this.ModifiedParent is the same as this.AffectedDefinition.</param> /// <param name="originalParent">The original parent of the affected definition (see also this.ModifiedParent). /// If the edit is a deletion, this.OriginalParent is the parent of this.AffectedDefinition. /// If this.AffectedDefinition does not have a parent then this.OriginalParent is the same as this.AffectedDefinition.</param> /// <param name="modifiedSourceDocument">The source document that is the result of the edit described by this edit instance.</param> /// <param name="originalSourceDocument">The source document that has been edited as described by this edit instance.</param> public EditDescriptor(EditEventKind kind, IDefinition affectedDefinition, IDefinition modifiedParent, IDefinition originalParent, ISourceDocument modifiedSourceDocument, ISourceDocument originalSourceDocument) //^ requires modifiedSourceDocument.IsUpdatedVersionOf(originalSourceDocument); { this.kind = kind; this.affectedDefinition = affectedDefinition; this.modifiedSourceDocument = modifiedSourceDocument; this.modifiedParent = modifiedParent; this.originalSourceDocument = originalSourceDocument; this.originalParent = originalParent; }
//^ requires modifiedSourceDocument.IsUpdatedVersionOf(originalSourceDocument); /// <summary> /// Allocates an object that describes an edit to a compilation as being either the addition, deletion or modification of a definition. /// </summary> /// <param name="kind">The kind of edit that has been performed (addition, deletion or modification).</param> /// <param name="affectedDefinition">The definition that has been added, deleted or modified.</param> /// <param name="modifiedParent">The new version of the parent of the affected definition (see also this.OriginalParent). /// If the edit is an addition or modification, this.ModifiedParent is the actual parent of this.AffectedDefinition. /// If this.AffectedDefinition does not have a parent then this.ModifiedParent is the same as this.AffectedDefinition.</param> /// <param name="originalParent">The original parent of the affected definition (see also this.ModifiedParent). /// If the edit is a deletion, this.OriginalParent is the parent of this.AffectedDefinition. /// If this.AffectedDefinition does not have a parent then this.OriginalParent is the same as this.AffectedDefinition.</param> /// <param name="modifiedSourceDocument">The source document that is the result of the edit described by this edit instance.</param> /// <param name="originalSourceDocument">The source document that has been edited as described by this edit instance.</param> public EditDescriptor(EditEventKind kind, IDefinition affectedDefinition, IDefinition modifiedParent, IDefinition originalParent, ISourceDocument modifiedSourceDocument, ISourceDocument originalSourceDocument) { this.kind = kind; this.affectedDefinition = affectedDefinition; this.modifiedSourceDocument = modifiedSourceDocument; this.modifiedParent = modifiedParent; this.originalSourceDocument = originalSourceDocument; this.originalParent = originalParent; }