mirror of https://github.com/icsharpcode/ILSpy.git
54 changed files with 1478 additions and 208 deletions
@ -0,0 +1,107 @@
@@ -0,0 +1,107 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.AvalonEdit.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Represents a string with a segment.
|
||||
/// Similar to System.ArraySegment<T>, but for strings instead of arrays.
|
||||
/// </summary>
|
||||
public struct StringSegment : IEquatable<StringSegment> |
||||
{ |
||||
readonly string text; |
||||
readonly int offset; |
||||
readonly int count; |
||||
|
||||
/// <summary>
|
||||
/// Creates a new StringSegment.
|
||||
/// </summary>
|
||||
public StringSegment(string text, int offset, int count) |
||||
{ |
||||
if (text == null) |
||||
throw new ArgumentNullException("text"); |
||||
if (offset < 0 || offset > text.Length) |
||||
throw new ArgumentOutOfRangeException("offset"); |
||||
if (offset + count > text.Length) |
||||
throw new ArgumentOutOfRangeException("count"); |
||||
this.text = text; |
||||
this.offset = offset; |
||||
this.count = count; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Creates a new StringSegment.
|
||||
/// </summary>
|
||||
public StringSegment(string text) |
||||
{ |
||||
if (text == null) |
||||
throw new ArgumentNullException("text"); |
||||
this.text = text; |
||||
this.offset = 0; |
||||
this.count = text.Length; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the string used for this segment.
|
||||
/// </summary>
|
||||
public string Text { |
||||
get { return text; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the start offset of the segment with the text.
|
||||
/// </summary>
|
||||
public int Offset { |
||||
get { return offset; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the segment.
|
||||
/// </summary>
|
||||
public int Count { |
||||
get { return count; } |
||||
} |
||||
|
||||
#region Equals and GetHashCode implementation
|
||||
/// <inheritdoc/>
|
||||
public override bool Equals(object obj) |
||||
{ |
||||
if (obj is StringSegment) |
||||
return Equals((StringSegment)obj); // use Equals method below
|
||||
else |
||||
return false; |
||||
} |
||||
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(StringSegment other) |
||||
{ |
||||
// add comparisions for all members here
|
||||
return object.ReferenceEquals(this.text, other.text) && offset == other.offset && count == other.count; |
||||
} |
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() |
||||
{ |
||||
return text.GetHashCode() ^ offset ^ count; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Equality operator.
|
||||
/// </summary>
|
||||
public static bool operator ==(StringSegment left, StringSegment right) |
||||
{ |
||||
return left.Equals(right); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Inequality operator.
|
||||
/// </summary>
|
||||
public static bool operator !=(StringSegment left, StringSegment right) |
||||
{ |
||||
return !left.Equals(right); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
||||
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
|
||||
namespace ICSharpCode.Decompiler |
||||
{ |
||||
/// <summary>
|
||||
/// Represents an error while resolving a reference to a type or a member.
|
||||
/// </summary>
|
||||
[Serializable] |
||||
public class ReferenceResolvingException : Exception |
||||
{ |
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:ResolveException"/> class
|
||||
/// </summary>
|
||||
public ReferenceResolvingException() |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:ResolveException"/> class
|
||||
/// </summary>
|
||||
/// <param name="message">A <see cref="T:System.String"/> that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.</param>
|
||||
public ReferenceResolvingException(string message) |
||||
: base(message) |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:ResolveException"/> class
|
||||
/// </summary>
|
||||
/// <param name="message">A <see cref="T:System.String"/> that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.</param>
|
||||
/// <param name="inner">The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param>
|
||||
public ReferenceResolvingException(string message, Exception inner) |
||||
: base(message, inner) |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:ResolveException"/> class
|
||||
/// </summary>
|
||||
/// <param name="info">The object that holds the serialized object data.</param>
|
||||
/// <param name="context">The contextual information about the source or destination.</param>
|
||||
protected ReferenceResolvingException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) |
||||
: base(info, context) |
||||
{ |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,108 @@
@@ -0,0 +1,108 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using DiffLib; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.Helpers |
||||
{ |
||||
public class CodeAssert |
||||
{ |
||||
public static void AreEqual(string input1, string input2) |
||||
{ |
||||
var diff = new StringWriter(); |
||||
if (!Compare(input1, input2, diff)) { |
||||
Assert.Fail(diff.ToString()); |
||||
} |
||||
} |
||||
|
||||
static bool Compare(string input1, string input2, StringWriter diff) |
||||
{ |
||||
var differ = new AlignedDiff<string>( |
||||
NormalizeAndSplitCode(input1), |
||||
NormalizeAndSplitCode(input2), |
||||
new CodeLineEqualityComparer(), |
||||
new StringSimilarityComparer(), |
||||
new StringAlignmentFilter()); |
||||
|
||||
bool result = true, ignoreChange; |
||||
|
||||
int line1 = 0, line2 = 0; |
||||
|
||||
foreach (var change in differ.Generate()) { |
||||
switch (change.Change) { |
||||
case ChangeType.Same: |
||||
diff.Write("{0,4} {1,4} ", ++line1, ++line2); |
||||
diff.Write(" "); |
||||
diff.WriteLine(change.Element1); |
||||
break; |
||||
case ChangeType.Added: |
||||
diff.Write(" {1,4} ", line1, ++line2); |
||||
result &= ignoreChange = ShouldIgnoreChange(change.Element2); |
||||
diff.Write(ignoreChange ? " " : " + "); |
||||
diff.WriteLine(change.Element2); |
||||
break; |
||||
case ChangeType.Deleted: |
||||
diff.Write("{0,4} ", ++line1, line2); |
||||
result &= ignoreChange = ShouldIgnoreChange(change.Element1); |
||||
diff.Write(ignoreChange ? " " : " - "); |
||||
diff.WriteLine(change.Element1); |
||||
break; |
||||
case ChangeType.Changed: |
||||
diff.Write("{0,4} ", ++line1, line2); |
||||
result = false; |
||||
diff.Write("(-) "); |
||||
diff.WriteLine(change.Element1); |
||||
diff.Write(" {1,4} ", line1, ++line2); |
||||
diff.Write("(+) "); |
||||
diff.WriteLine(change.Element2); |
||||
break; |
||||
} |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
class CodeLineEqualityComparer : IEqualityComparer<string> |
||||
{ |
||||
private IEqualityComparer<string> baseComparer = EqualityComparer<string>.Default; |
||||
|
||||
public bool Equals(string x, string y) |
||||
{ |
||||
return baseComparer.Equals( |
||||
NormalizeLine(x), |
||||
NormalizeLine(y) |
||||
); |
||||
} |
||||
|
||||
public int GetHashCode(string obj) |
||||
{ |
||||
return baseComparer.GetHashCode(NormalizeLine(obj)); |
||||
} |
||||
} |
||||
|
||||
private static string NormalizeLine(string line) |
||||
{ |
||||
line = line.Trim(); |
||||
var index = line.IndexOf("//"); |
||||
if (index >= 0) { |
||||
return line.Substring(0, index); |
||||
} else { |
||||
return line; |
||||
} |
||||
} |
||||
|
||||
private static bool ShouldIgnoreChange(string line) |
||||
{ |
||||
// for the result, we should ignore blank lines and added comments
|
||||
return NormalizeLine(line) == string.Empty; |
||||
} |
||||
|
||||
private static IEnumerable<string> NormalizeAndSplitCode(string input) |
||||
{ |
||||
return input.Split(new[] { "\r\n", "\n\r", "\n", "\r" }, StringSplitOptions.None); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
|
||||
public class UndocumentedExpressions |
||||
{ |
||||
public static int GetArgCount(__arglist) |
||||
{ |
||||
ArgIterator argIterator = new ArgIterator(__arglist); |
||||
return argIterator.GetRemainingCount(); |
||||
} |
||||
|
||||
public static void MakeTypedRef(object o) |
||||
{ |
||||
TypedReference tr = __makeref(o); |
||||
UndocumentedExpressions.AcceptTypedRef(tr); |
||||
} |
||||
|
||||
private static void AcceptTypedRef(TypedReference tr) |
||||
{ |
||||
Console.WriteLine("Value is: " + __refvalue(tr, object).ToString()); |
||||
Console.WriteLine("Type is: " + __reftype(tr).Name); |
||||
__refvalue(tr, object) = 1; |
||||
} |
||||
} |
||||
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<packages> |
||||
<package id="DiffLib" version="1.0.0.55" /> |
||||
</packages> |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using Mono.Cecil; |
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes.Analyzer |
||||
{ |
||||
static class Helpers |
||||
{ |
||||
public static bool IsReferencedBy(TypeDefinition type, TypeReference typeRef) |
||||
{ |
||||
// TODO: move it to a better place after adding support for more cases.
|
||||
if (type == null) |
||||
throw new ArgumentNullException("type"); |
||||
if (typeRef == null) |
||||
throw new ArgumentNullException("typeRef"); |
||||
|
||||
if (type == typeRef) |
||||
return true; |
||||
if (type.Name != typeRef.Name) |
||||
return false; |
||||
if (type.Namespace != typeRef.Namespace) |
||||
return false; |
||||
|
||||
if (type.DeclaringType != null || typeRef.DeclaringType != null) { |
||||
if (type.DeclaringType == null || typeRef.DeclaringType == null) |
||||
return false; |
||||
if (!IsReferencedBy(type.DeclaringType, typeRef.DeclaringType)) |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
Binary file not shown.
@ -0,0 +1,641 @@
@@ -0,0 +1,641 @@
|
||||
<?xml version="1.0"?> |
||||
<doc> |
||||
<assembly> |
||||
<name>DiffLib</name> |
||||
</assembly> |
||||
<members> |
||||
<member name="T:DiffLib.AlignedDiffChange`1"> |
||||
<summary> |
||||
This class holds a single collection from either the first or the second, or both, |
||||
collections given to the <see cref="T:DiffLib.AlignedDiff`1"/> class, along |
||||
with the type of change that the elements produce. |
||||
</summary> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiffChange`1.#ctor(DiffLib.ChangeType,`0,`0)"> |
||||
<summary> |
||||
Initializes a new instance of <see cref="T:DiffLib.AlignedDiffChange`1"/>. |
||||
</summary> |
||||
<param name="change"> |
||||
The <see cref="P:DiffLib.AlignedDiffChange`1.Change">type</see> of change this <see cref="T:DiffLib.AlignedDiffChange`1"/> details. |
||||
</param> |
||||
<param name="element1"> |
||||
The element from the first collection. If <paramref name="change"/> is <see cref="F:DiffLib.ChangeType.Added"/>, then |
||||
this parameter has no meaning. |
||||
</param> |
||||
<param name="element2"> |
||||
The element from the second collection. If <paramref name="change"/> is <see cref="F:DiffLib.ChangeType.Deleted"/>, then |
||||
this parameter has no meaning. |
||||
</param> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiffChange`1.Equals(DiffLib.AlignedDiffChange{`0})"> |
||||
<summary> |
||||
Indicates whether the current object is equal to another object of the same type. |
||||
</summary> |
||||
<returns> |
||||
true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. |
||||
</returns> |
||||
<param name="other">An object to compare with this object.</param> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiffChange`1.Equals(System.Object)"> |
||||
<summary> |
||||
Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>. |
||||
</summary> |
||||
<returns> |
||||
true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false. |
||||
</returns> |
||||
<param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiffChange`1.GetHashCode"> |
||||
<summary> |
||||
Serves as a hash function for a particular type. |
||||
</summary> |
||||
<returns> |
||||
A hash code for the current <see cref="T:System.Object"/>. |
||||
</returns> |
||||
<filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiffChange`1.ToString"> |
||||
<summary> |
||||
Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. |
||||
</summary> |
||||
<returns> |
||||
A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. |
||||
</returns> |
||||
<filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="P:DiffLib.AlignedDiffChange`1.Change"> |
||||
<summary> |
||||
The <see cref="P:DiffLib.AlignedDiffChange`1.Change">type</see> of change this <see cref="T:DiffLib.AlignedDiffChange`1"/> details. |
||||
</summary> |
||||
</member> |
||||
<member name="P:DiffLib.AlignedDiffChange`1.Element1"> |
||||
<summary> |
||||
The element from the first collection. If <see cref="T:System.Type"/> is <see cref="F:DiffLib.ChangeType.Added"/>, then |
||||
the value of this property has no meaning. |
||||
</summary> |
||||
</member> |
||||
<member name="P:DiffLib.AlignedDiffChange`1.Element2"> |
||||
<summary> |
||||
The element from the second collection. If <see cref="T:System.Type"/> is <see cref="F:DiffLib.ChangeType.Deleted"/>, then |
||||
the value of this property has no meaning. |
||||
</summary> |
||||
</member> |
||||
<member name="T:DiffLib.ChangeType"> |
||||
<summary> |
||||
This enum is used by <see cref="T:DiffLib.AlignedDiffChange`1"/> to specify how |
||||
the two elements from the two collections relate. |
||||
</summary> |
||||
</member> |
||||
<member name="F:DiffLib.ChangeType.Same"> |
||||
<summary> |
||||
The two elements are the same. |
||||
</summary> |
||||
</member> |
||||
<member name="F:DiffLib.ChangeType.Added"> |
||||
<summary> |
||||
The second element was added in the second collection. |
||||
</summary> |
||||
</member> |
||||
<member name="F:DiffLib.ChangeType.Deleted"> |
||||
<summary> |
||||
The first element was removed from the second collection. |
||||
</summary> |
||||
</member> |
||||
<member name="F:DiffLib.ChangeType.Changed"> |
||||
<summary> |
||||
The first element was changed/replaced with the second element in the second collection. |
||||
</summary> |
||||
</member> |
||||
<member name="T:DiffLib.Diff`1"> |
||||
<summary> |
||||
This class implements the basic diff algorithm by recursively applying the Longest Common Substring |
||||
on pieces of the collections, and reporting sections that are similar, and those that are not, |
||||
in the appropriate sequence. |
||||
</summary> |
||||
<typeparam name="T"> |
||||
The types of elements in the collections being compared. |
||||
</typeparam> |
||||
</member> |
||||
<member name="M:DiffLib.Diff`1.#ctor(System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEnumerable{`0})"> |
||||
<summary> |
||||
Initializes a new instance of <see cref="T:DiffLib.Diff`1"/> |
||||
using the default <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> instance for the |
||||
<typeparamref name="T"/> type. |
||||
</summary> |
||||
<param name="collection1"> |
||||
The first collection of items. |
||||
</param> |
||||
<param name="collection2"> |
||||
The second collection of items. |
||||
</param> |
||||
<exception cref="T:System.ArgumentNullException"> |
||||
<para><paramref name="collection1"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="collection2"/> is <c>null</c>.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="M:DiffLib.Diff`1.#ctor(System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEqualityComparer{`0})"> |
||||
<summary> |
||||
Initializes a new instance of <see cref="T:DiffLib.Diff`1"/>. |
||||
</summary> |
||||
<param name="collection1"> |
||||
The first collection of items. |
||||
</param> |
||||
<param name="collection2"> |
||||
The second collection of items. |
||||
</param> |
||||
<param name="comparer"> |
||||
The <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> that will be used to compare elements from |
||||
<paramref name="collection1"/> with elements from <paramref name="collection2"/>. |
||||
</param> |
||||
<exception cref="T:System.ArgumentNullException"> |
||||
<para><paramref name="collection1"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="collection2"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="comparer"/> is <c>null</c>.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="M:DiffLib.Diff`1.GetEnumerator"> |
||||
<summary> |
||||
Returns an enumerator that iterates through the collection. |
||||
</summary> |
||||
<returns> |
||||
A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection. |
||||
</returns> |
||||
<filterpriority>1</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.Diff`1.Generate"> |
||||
<summary> |
||||
Generates the diff between the two collections. |
||||
</summary> |
||||
</member> |
||||
<member name="T:DiffLib.DiffChange"> |
||||
<summary> |
||||
This class contains a single section of diff output from the <see cref="M:DiffLib.Diff`1.Generate"/> |
||||
method. |
||||
</summary> |
||||
</member> |
||||
<member name="M:DiffLib.DiffChange.#ctor(System.Boolean,System.Int32,System.Int32)"> |
||||
<summary> |
||||
Initializes a new instance of <see cref="T:DiffLib.DiffChange"/>. |
||||
</summary> |
||||
<param name="equal"> |
||||
If <c>true</c>, then the section specifies a section from the first |
||||
collection that is equal to a section from the second collection; |
||||
otherwise, if <c>false</c>, then the section from the first |
||||
collection was replaced with the section from the second collection. |
||||
</param> |
||||
<param name="length1"> |
||||
The length of the section in the first collection. Can be 0 if |
||||
the section specifies that new content was added in the second |
||||
collection. |
||||
</param> |
||||
<param name="length2"> |
||||
The length of the section in the second collection. Can be 0 if |
||||
the section specifies that old content was deleted in the second |
||||
collection. |
||||
</param> |
||||
<exception cref="T:System.ArgumentOutOfRangeException"> |
||||
<para><paramref name="length1"/> is negative.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="length2"/> is negative.</para> |
||||
</exception> |
||||
<exception cref="T:System.ArgumentException"> |
||||
<para><paramref name="equal"/> is <c>true</c> but <paramref name="length1"/> is not equal to <paramref name="length2"/>.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="M:DiffLib.DiffChange.Equals(DiffLib.DiffChange)"> |
||||
<summary> |
||||
Indicates whether the current object is equal to another object of the same type. |
||||
</summary> |
||||
<returns> |
||||
true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. |
||||
</returns> |
||||
<param name="other">An object to compare with this object.</param> |
||||
</member> |
||||
<member name="M:DiffLib.DiffChange.Equals(System.Object)"> |
||||
<summary> |
||||
Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>. |
||||
</summary> |
||||
<returns> |
||||
true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false. |
||||
</returns> |
||||
<param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.DiffChange.GetHashCode"> |
||||
<summary> |
||||
Serves as a hash function for a particular type. |
||||
</summary> |
||||
<returns> |
||||
A hash code for the current <see cref="T:System.Object"/>. |
||||
</returns> |
||||
<filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.DiffChange.ToString"> |
||||
<summary> |
||||
Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. |
||||
</summary> |
||||
<returns> |
||||
A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. |
||||
</returns> |
||||
<filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="P:DiffLib.DiffChange.Equal"> |
||||
<summary> |
||||
Gets whether the <see cref="T:DiffLib.DiffChange"/> specifies equal sections in the two |
||||
collections, or differing sections. |
||||
</summary> |
||||
<value> |
||||
If <c>true</c>, then the section specifies a section from the first |
||||
collection that is equal to a section from the second collection; |
||||
otherwise, if <c>false</c>, then the section from the first |
||||
collection was replaced with the section from the second collection. |
||||
</value> |
||||
</member> |
||||
<member name="P:DiffLib.DiffChange.Length1"> |
||||
<summary> |
||||
The length of the section in the first collection. |
||||
</summary> |
||||
</member> |
||||
<member name="P:DiffLib.DiffChange.Length2"> |
||||
<summary> |
||||
The length of the section in the second collection. |
||||
</summary> |
||||
</member> |
||||
<member name="T:DiffLib.IAlignmentFilter`1"> |
||||
<summary> |
||||
This interface must be implemented by classes that will do similarity-filtering |
||||
during alignment (<see cref="T:DiffLib.AlignedDiff`1"/>) to determine |
||||
if two aligned elements are similar enough to report |
||||
them as a change, instead of as a delete plus an add. |
||||
</summary> |
||||
<typeparam name="T"> |
||||
The type of elements being compared. |
||||
</typeparam> |
||||
</member> |
||||
<member name="M:DiffLib.IAlignmentFilter`1.CanAlign(`0,`0)"> |
||||
<summary> |
||||
Determines if the two values are similar enough to align them |
||||
as a change, instead of not aligning them but reporting them |
||||
as a delete plus an add instead. |
||||
</summary> |
||||
<param name="value1"> |
||||
The first value to compare against <paramref name="value2"/>. |
||||
</param> |
||||
<param name="value2"> |
||||
The second value to compare against <paramref name="value1"/>. |
||||
</param> |
||||
<returns> |
||||
<c>true</c> if the two values are similar enough to report |
||||
them as a change; false if the two values aren't similar enough |
||||
but needs to be reported as a delete plus an add. |
||||
</returns> |
||||
</member> |
||||
<member name="T:DiffLib.ISimilarityComparer`1"> |
||||
<summary> |
||||
This interface must be implemented by classes that will do similarity-calculation |
||||
for use with the <see cref="T:DiffLib.AlignedDiff`1"/> class. |
||||
</summary> |
||||
<typeparam name="T"> |
||||
The type of elements being compared. |
||||
</typeparam> |
||||
</member> |
||||
<member name="M:DiffLib.ISimilarityComparer`1.Compare(`0,`0)"> |
||||
<summary> |
||||
Does a similarity comparison between the two values and returns their |
||||
similarity, a value ranging from 0.0 to 1.0, where 0.0 means they're |
||||
completely different and 1.0 means they have the same value. |
||||
</summary> |
||||
<param name="value1"> |
||||
The first value to compare. |
||||
</param> |
||||
<param name="value2"> |
||||
The second value to compare. |
||||
</param> |
||||
<returns> |
||||
A value ranging from 0.0 to 1.0, where 0.0 means they're |
||||
completely different and 1.0 means they have the same value. |
||||
</returns> |
||||
</member> |
||||
<member name="T:DiffLib.LongestCommonSubstring`1"> |
||||
<summary> |
||||
This class implements the LCS algorithm, to find the longest common substring that exists |
||||
in two collections, and return the locations of those substrings. |
||||
</summary> |
||||
<typeparam name="T"> |
||||
The types of elements in the collections being compared. |
||||
</typeparam> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstring`1.#ctor(System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEnumerable{`0})"> |
||||
<summary> |
||||
Initializes a new instance of the <see cref="T:DiffLib.LongestCommonSubstring`1"/> class |
||||
using the default <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> instance for the |
||||
<typeparamref name="T"/> type. |
||||
</summary> |
||||
<param name="collection1"> |
||||
The first collection of items. |
||||
</param> |
||||
<param name="collection2"> |
||||
The second collection of items. |
||||
</param> |
||||
<exception cref="T:System.ArgumentNullException"> |
||||
<para><paramref name="collection1"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="collection2"/> is <c>null</c>.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstring`1.#ctor(System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEqualityComparer{`0})"> |
||||
<summary> |
||||
Initializes a new instance of the <see cref="T:DiffLib.LongestCommonSubstring`1"/> class. |
||||
</summary> |
||||
<param name="collection1"> |
||||
The first collection of items. |
||||
</param> |
||||
<param name="collection2"> |
||||
The second collection of items. |
||||
</param> |
||||
<param name="comparer"> |
||||
The <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> that will be used to compare elements from |
||||
<paramref name="collection1"/> with elements from <paramref name="collection2"/>. |
||||
</param> |
||||
<exception cref="T:System.ArgumentNullException"> |
||||
<para><paramref name="collection1"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="collection2"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="comparer"/> is <c>null</c>.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstring`1.Find"> |
||||
<summary> |
||||
Finds the longest common substring and returns its position in the two collections, and |
||||
its length, or <c>null</c> if no such common substring can be located. |
||||
</summary> |
||||
<returns> |
||||
A <see cref="T:DiffLib.LongestCommonSubstringResult"/> containing the positions of the two substrings, one position |
||||
for each collection, both 0-based, and the length of the substring. If no common substring can be found, <c>null</c> |
||||
will be returned. |
||||
</returns> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstring`1.Find(System.Int32,System.Int32,System.Int32,System.Int32)"> |
||||
<summary> |
||||
Finds the longest common substring and returns its position in the two collections, and |
||||
its length, or <c>null</c> if no such common substring can be located. |
||||
</summary> |
||||
<param name="lower1"> |
||||
The starting position in the first collection, 0-based. Included in the search. |
||||
</param> |
||||
<param name="upper1"> |
||||
The ending position in the first collection, 0-based. <b>Not</b> included in the search. |
||||
</param> |
||||
<param name="lower2"> |
||||
The starting position in the second collection, 0-based. Included in the search. |
||||
</param> |
||||
<param name="upper2"> |
||||
The ending position in the second collection, 0-based. <b>Not</b> included in the search. |
||||
</param> |
||||
<returns> |
||||
A <see cref="T:DiffLib.LongestCommonSubstringResult"/> containing the positions of the two substrings, one position |
||||
for each collection, both 0-based, and the length of the substring. If no common substring can be found, <c>null</c> |
||||
will be returned. |
||||
</returns> |
||||
<exception cref="T:System.ArgumentOutOfRangeException"> |
||||
<para><paramref name="lower1"/> is less than 0.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="lower1"/> is greater than <paramref name="upper1"/>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="upper1"/> is greater than the length of the first collection.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="lower2"/> is less than 0.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="lower2"/> is greater than <paramref name="upper2"/>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="upper2"/> is greater than the length of the second collection.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="T:DiffLib.LongestCommonSubstringResult"> |
||||
<summary> |
||||
This class holds the result of calling <see cref="M:DiffLib.LongestCommonSubstring`1.Find"/>. |
||||
</summary> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstringResult.#ctor(System.Int32,System.Int32,System.Int32)"> |
||||
<summary> |
||||
Initializes a new instance of <see cref="T:DiffLib.LongestCommonSubstringResult"/>. |
||||
</summary> |
||||
<param name="positionInCollection1"> |
||||
The position in the first collection, 0-based. |
||||
</param> |
||||
<param name="positionInCollection2"> |
||||
The position in the second collection, 0-based. |
||||
</param> |
||||
<param name="length"> |
||||
The length of the common substring. |
||||
</param> |
||||
<exception cref="T:System.ArgumentOutOfRangeException"> |
||||
<para><paramref name="positionInCollection1"/> is negative.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="positionInCollection2"/> is negative.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="length"/> is zero or negative.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstringResult.Equals(DiffLib.LongestCommonSubstringResult)"> |
||||
<summary> |
||||
Indicates whether the current object is equal to another object of the same type. |
||||
</summary> |
||||
<returns> |
||||
true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. |
||||
</returns> |
||||
<param name="other">An object to compare with this object.</param> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstringResult.Equals(System.Object)"> |
||||
<summary> |
||||
Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>. |
||||
</summary> |
||||
<returns> |
||||
true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false. |
||||
</returns> |
||||
<param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstringResult.GetHashCode"> |
||||
<summary> |
||||
Serves as a hash function for a particular type. |
||||
</summary> |
||||
<returns> |
||||
A hash code for the current <see cref="T:System.Object"/>. |
||||
</returns> |
||||
<filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.LongestCommonSubstringResult.ToString"> |
||||
<summary> |
||||
Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. |
||||
</summary> |
||||
<returns> |
||||
A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>. |
||||
</returns> |
||||
<filterpriority>2</filterpriority> |
||||
</member> |
||||
<member name="P:DiffLib.LongestCommonSubstringResult.PositionInCollection1"> |
||||
<summary> |
||||
The position in the first collection, 0-based. |
||||
</summary> |
||||
</member> |
||||
<member name="P:DiffLib.LongestCommonSubstringResult.PositionInCollection2"> |
||||
<summary> |
||||
The position in the second collection, 0-based. |
||||
</summary> |
||||
</member> |
||||
<member name="P:DiffLib.LongestCommonSubstringResult.Length"> |
||||
<summary> |
||||
The length of the common substring. |
||||
</summary> |
||||
</member> |
||||
<member name="T:DiffLib.AlignedDiff`1"> |
||||
<summary> |
||||
This class implements a slightly more advanced diff algorithm than <see cref="T:DiffLib.Diff`1"/> by |
||||
taking the output from <see cref="T:DiffLib.Diff`1"/> and attempting to align individual elements inside |
||||
replace-blocks. This is mostly suitable for text file diffs. |
||||
</summary> |
||||
<typeparam name="T"> |
||||
The types of elements in the collections being compared. |
||||
</typeparam> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiff`1.#ctor(System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEqualityComparer{`0},DiffLib.ISimilarityComparer{`0},DiffLib.IAlignmentFilter{`0})"> |
||||
<summary> |
||||
Initializes a new instance of <see cref="T:DiffLib.AlignedDiff`1"/>. |
||||
</summary> |
||||
<param name="collection1"> |
||||
The first collection of items. |
||||
</param> |
||||
<param name="collection2"> |
||||
The second collection of items. |
||||
</param> |
||||
<param name="equalityComparer"> |
||||
The <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> that will be used to compare elements from |
||||
<paramref name="collection1"/> with elements from <paramref name="collection2"/>. |
||||
</param> |
||||
<param name="similarityComparer"> |
||||
The <see cref="T:DiffLib.ISimilarityComparer`1"/> that will be used to attempt to align elements |
||||
inside blocks that consists of elements from the first collection being replaced |
||||
with elements from the second collection. |
||||
</param> |
||||
<param name="alignmentFilter"> |
||||
The <see cref="T:DiffLib.ISimilarityComparer`1"/> that will be used to determine if |
||||
two aligned elements are similar enough to be report them as a change from |
||||
one to another, or to report them as one being deleted and the other added in |
||||
its place. |
||||
</param> |
||||
<exception cref="T:System.ArgumentNullException"> |
||||
<para><paramref name="collection1"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="collection2"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="equalityComparer"/> is <c>null</c>.</para> |
||||
<para>- or -</para> |
||||
<para><paramref name="alignmentFilter"/> is <c>null</c>.</para> |
||||
</exception> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiff`1.GetEnumerator"> |
||||
<summary> |
||||
Returns an enumerator that iterates through the collection. |
||||
</summary> |
||||
<returns> |
||||
A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection. |
||||
</returns> |
||||
<filterpriority>1</filterpriority> |
||||
</member> |
||||
<member name="M:DiffLib.AlignedDiff`1.Generate"> |
||||
<summary> |
||||
Generates the diff, one line of output at a time. |
||||
</summary> |
||||
<returns> |
||||
A collection of <see cref="T:DiffLib.AlignedDiffChange`1"/> objects, one for |
||||
each line in the first or second collection (sometimes one instance for a line |
||||
from both, when lines are equal or similar.) |
||||
</returns> |
||||
</member> |
||||
<member name="T:DiffLib.StringSimilarityComparer"> |
||||
<summary> |
||||
This class implements <see cref="T:DiffLib.ISimilarityComparer`1"/> for strings, doing a very basic "diff" between the two, |
||||
and calculating how much of the text occurs in both. |
||||
</summary> |
||||
</member> |
||||
<member name="M:DiffLib.StringSimilarityComparer.Compare(System.String,System.String)"> |
||||
<summary> |
||||
Does a similarity comparison between the two values and returns their |
||||
similarity, a value ranging from 0.0 to 1.0, where 0.0 means they're |
||||
completely different and 1.0 means they have the same value. |
||||
</summary> |
||||
<param name="value1"> |
||||
The first value to compare. |
||||
</param> |
||||
<param name="value2"> |
||||
The second value to compare. |
||||
</param> |
||||
<returns> |
||||
A value ranging from 0.0 to 1.0, where 0.0 means they're |
||||
completely different and 1.0 means they have the same value. |
||||
</returns> |
||||
</member> |
||||
<member name="T:DiffLib.StringAlignmentFilter"> |
||||
<summary> |
||||
This class implements <see cref="T:DiffLib.ISimilarityComparer`1"/> for strings, doing a very basic "diff" between the two, |
||||
and calculating how much of the text occurs in both. |
||||
</summary> |
||||
</member> |
||||
<member name="M:DiffLib.StringAlignmentFilter.#ctor"> |
||||
<summary> |
||||
Initializes a new instance of the <see cref="T:DiffLib.StringAlignmentFilter"/> class. |
||||
</summary> |
||||
</member> |
||||
<member name="M:DiffLib.StringAlignmentFilter.#ctor(DiffLib.StringSimilarityFilterPredicate)"> |
||||
<summary> |
||||
Initializes a new instance of the <see cref="T:DiffLib.StringAlignmentFilter"/> class. |
||||
</summary> |
||||
<param name="diffPredicate"> |
||||
The diff predicate used to determine if the strings are |
||||
similar enough (see <see cref="T:DiffLib.StringSimilarityFilterPredicate"/> for details. |
||||
</param> |
||||
<exception cref="T:System.ArgumentNullException"><paramref name="diffPredicate"/> is <c>null</c>.</exception> |
||||
</member> |
||||
<member name="M:DiffLib.StringAlignmentFilter.CanAlign(System.String,System.String)"> |
||||
<summary> |
||||
Determines if the two values are similar enough to align them |
||||
as a change, instead of not aligning them but reporting them |
||||
as a delete plus an add instead. |
||||
</summary> |
||||
<param name="value1"> |
||||
The first value to compare against <paramref name="value2"/>. |
||||
</param> |
||||
<param name="value2"> |
||||
The second value to compare against <paramref name="value1"/>. |
||||
</param> |
||||
<returns> |
||||
<c>true</c> if the two values are similar enough to report |
||||
them as a change; false if the two values aren't similar enough |
||||
but needs to be reported as a delete plus an add. |
||||
</returns> |
||||
</member> |
||||
<member name="T:DiffLib.StringSimilarityFilterPredicate"> |
||||
<summary> |
||||
This delegate is used by <see cref="T:DiffLib.StringAlignmentFilter"/> to |
||||
determine if the two strings are similar enough to report them |
||||
as a change, instead of as a delete plus and add. |
||||
</summary> |
||||
<param name="value1"> |
||||
The first string to compare. |
||||
</param> |
||||
<param name="value2"> |
||||
The second string to compare. |
||||
</param> |
||||
<param name="diff"> |
||||
The diff between <paramref name="value1"/> and <paramref name="value2"/>. |
||||
</param> |
||||
<returns> |
||||
<c>true</c> if the strings are similar enough (reported as a change); |
||||
otherwise, <c>false</c> (reported as a delete plus an add.) |
||||
</returns> |
||||
</member> |
||||
</members> |
||||
</doc> |
||||
Binary file not shown.
Loading…
Reference in new issue