# OfficeDiffEdit

One contiguous run of an edit script.

Struct 

`OfficeIMO.Diff`

**Namespace**

`OfficeIMO.Diff`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeDiffTypes.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L31)

**Base**

`ValueType`

**Implements**

`IEquatable<OfficeDiffEdit>`

**Modifiers**

sealed

One contiguous run of an edit script.

## Inheritance

- ValueType
- OfficeDiffEdit

## Remarks

[OfficeDiffEdit.OldStart](/api/core/officeimo-diff-officediffedit/) and [OfficeDiffEdit.NewStart](/api/core/officeimo-diff-officediffedit/) are always the positions in each sequence where the run applies. For [OfficeDiffOperation.Insert](/api/core/officeimo-diff-officediffoperation/) the old length is zero; for [OfficeDiffOperation.Delete](/api/core/officeimo-diff-officediffoperation/) the new length is zero.

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Property [OfficeDiffResult<T>.Edits](/api/core/officeimo-diff-officediffresult/#property-edits)

### Accepted by parameters 1

- Method [OfficeDiffEdit.Equals](/api/core/officeimo-diff-officediffedit/#method-equals-officeimo-diff-officediffedit) parameter `other`

Filter members 

Show inherited

## Constructors

`public OfficeDiffEdit(OfficeDiffOperation operation, int oldStart, int oldLength, int newStart, int newLength)` [#](#constructor-ctor-officeimo-diff-officediffoperation-int32-int32-int32-int32)

[OfficeDiffTypes.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L31)

Creates an edit run.

Parameters

**operation OfficeIMO.Diff.OfficeDiffOperation required**

**oldStart int required**

**oldLength int required**

**newStart int required**

**newLength int required**

## Methods

Equals 2 overloads

`public bool Equals(OfficeDiffEdit other)` [#](#method-equals-officeimo-diff-officediffedit)

[OfficeDiffTypes.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L62)

Indicates whether the current object is equal to another object of the same type.

Parameters

**other OfficeIMO.Diff.OfficeDiffEdit required**

An object to compare with this object.

Returns

`bool` true if the current object is equal to the other parameter; otherwise, false.

`public override bool Equals(object? obj)` [#](#method-equals-object)

[OfficeDiffTypes.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L66)

Indicates whether this instance and a specified object are equal.

Parameters

**obj object? required**

The object to compare with the current instance.

Returns

`bool` true if obj and this instance are the same type and represent the same value; otherwise, false.

`public override int GetHashCode()` [#](#method-gethashcode)

[OfficeDiffTypes.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L71)

Returns the hash code for this instance.

Returns

`int` A 32-bit signed integer that is the hash code for this instance.

`public override string ToString()` [#](#method-tostring)

[OfficeDiffTypes.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L80)

Returns the fully qualified type name of this instance.

Returns

`string` The fully qualified type name.

## Inherited Methods

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

## Properties

`public OfficeDiffOperation Operation { get; }` [#](#property-operation)

[OfficeDiffTypes.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L46)

Run operation.

`public int OldStart { get; }` [#](#property-oldstart)

[OfficeDiffTypes.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L49)

Zero-based start in the old sequence.

`public int OldLength { get; }` [#](#property-oldlength)

[OfficeDiffTypes.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L52)

Number of old items covered.

`public int NewStart { get; }` [#](#property-newstart)

[OfficeDiffTypes.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L55)

Zero-based start in the new sequence.

`public int NewLength { get; }` [#](#property-newlength)

[OfficeDiffTypes.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeDiffTypes.cs#L58)

Number of new items covered.

<!-- PowerForge markdown artifact sha256:DEC355E3DF8C921483C040A764D6D1B5D700A733166CF29AD9E3D5771E114082 -->
