Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with history navigation - entries not getting selected correctly, duplicate text in decompiler output #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions SharpTreeView/TreeFlattener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ICSharpCode.TreeView
{
sealed class TreeFlattener : IList, INotifyCollectionChanged
sealed class TreeFlattener : IList, IList<object>, INotifyCollectionChanged
{
/// <summary>
/// The root node of the flat list tree.
Expand Down Expand Up @@ -88,7 +88,7 @@ public int IndexOf(object item)
}
}

bool IList.IsReadOnly {
public bool IsReadOnly {
get { return true; }
}

Expand All @@ -106,12 +106,12 @@ public int IndexOf(object item)
}
}

void IList.Insert(int index, object item)
public void Insert(int index, object item)
{
throw new NotSupportedException();
}

void IList.RemoveAt(int index)
public void RemoveAt(int index)
{
throw new NotSupportedException();
}
Expand All @@ -121,7 +121,12 @@ int IList.Add(object item)
throw new NotSupportedException();
}

void IList.Clear()
public void Add(object item)
{
throw new NotSupportedException();
}

public void Clear()
{
throw new NotSupportedException();
}
Expand All @@ -137,16 +142,34 @@ public void CopyTo(Array array, int arrayIndex)
array.SetValue(item, arrayIndex++);
}

public void CopyTo(object[] array, int arrayIndex)
{
foreach (object item in this)
array.SetValue(item, arrayIndex++);
}

void IList.Remove(object item)
{
throw new NotSupportedException();
}

public bool Remove(object item)
{
throw new NotSupportedException();
}

public IEnumerator GetEnumerator()
{
for (int i = 0; i < this.Count; i++) {
yield return this[i];
}
}

IEnumerator<object> IEnumerable<object>.GetEnumerator()
{
for (int i = 0; i < this.Count; i++) {
yield return this[i];
}
}
}
}