IListMerger.ThreeWayMerge<T,U> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Given a baseline and two current lists, computes the merged result. The differences between the baseline and the current lists are analyzed in terms of the following operations:
- Add a new item to the front (index 0)
- Remove an item from anywhere This method derives an ordered list of operations that would transform the baseline into each of the current lists, combines them, and applies them to the baseline to generate the result. The order of operations in "first" and "second" is maintained within the list but not between lists; for example, if the baseline is {0}, first is {1,0} and second is {2,0}, the result may be {1,2,0} or {2,1,0}. Both are equally valid.
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<T,U>> ThreeWayMerge<T,U> (System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<T,U>> first, System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<T,U>> second, System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<T,U>> baseline, System.Collections.Generic.IEqualityComparer<T> keyComparer = default, System.Collections.Generic.IEqualityComparer<U> valueComparer = default, Microsoft.VisualStudio.Settings.Telemetry.ISettingsLogger logger = default);
abstract member ThreeWayMerge : System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<'T, 'U>> * System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<'T, 'U>> * System.Collections.Generic.IReadOnlyList<System.Collections.Generic.KeyValuePair<'T, 'U>> * System.Collections.Generic.IEqualityComparer<'T> * System.Collections.Generic.IEqualityComparer<'U> * Microsoft.VisualStudio.Settings.Telemetry.ISettingsLogger -> seq<System.Collections.Generic.KeyValuePair<'T, 'U>>
Public Function ThreeWayMerge(Of T, U) (first As IReadOnlyList(Of KeyValuePair(Of T, U)), second As IReadOnlyList(Of KeyValuePair(Of T, U)), baseline As IReadOnlyList(Of KeyValuePair(Of T, U)), Optional keyComparer As IEqualityComparer(Of T) = Nothing, Optional valueComparer As IEqualityComparer(Of U) = Nothing, Optional logger As ISettingsLogger = Nothing) As IEnumerable(Of KeyValuePair(Of T, U))
Type Parameters
- T
- U
Parameters
- first
- IReadOnlyList<KeyValuePair<T,U>>
- second
- IReadOnlyList<KeyValuePair<T,U>>
- baseline
- IReadOnlyList<KeyValuePair<T,U>>
- keyComparer
- IEqualityComparer<T>
- valueComparer
- IEqualityComparer<U>
- logger
- ISettingsLogger
Returns
IEnumerable<KeyValuePair<T,U>>
Exceptions
Thrown when first
, second
, or baseline
is null.