From c938b1789ae8f02099530587066b006af67d5908 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Tue, 23 May 2023 20:07:38 -0500 Subject: [PATCH] Implement IList by TreeNodeCollection --- UIX/Microsoft/Iris/Library/TreeNodeCollection.cs | 15 +++++++++++---- UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs | 7 ++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs b/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs index f68e60d..c3c51d1 100644 --- a/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs +++ b/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs @@ -6,10 +6,11 @@ using System; using System.Collections; +using System.Collections.Generic; namespace Microsoft.Iris.Library { - public struct TreeNodeCollection : IList, ICollection, IEnumerable + public struct TreeNodeCollection : IList, ICollection, IEnumerable, IList { private TreeNode _nodeSubject; @@ -19,11 +20,11 @@ namespace Microsoft.Iris.Library bool ICollection.IsSynchronized => false; - object ICollection.SyncRoot => (object)null; + object ICollection.SyncRoot => null; bool IList.IsFixedSize => false; - bool IList.IsReadOnly => false; + public bool IsReadOnly => false; object IList.this[int index] { @@ -53,7 +54,7 @@ namespace Microsoft.Iris.Library IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - public TreeNodeEnumerator GetEnumerator() => new TreeNodeEnumerator(_nodeSubject); + public IEnumerator GetEnumerator() => new TreeNodeEnumerator(_nodeSubject); void ICollection.CopyTo(Array destList, int destIndex) { @@ -112,5 +113,11 @@ namespace Microsoft.Iris.Library public void Remove(TreeNode nodeChild) => nodeChild.ChangeParent(null); public void RemoveAt(int removeAtIndex) => this[removeAtIndex].ChangeParent(null); + + bool ICollection.Remove(TreeNode item) + { + Remove(item); + return true; + } } } diff --git a/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs b/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs index e340a66..3e3b393 100644 --- a/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs +++ b/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs @@ -5,10 +5,11 @@ // Assembly location: C:\Program Files\Zune\UIX.dll using System.Collections; +using System.Collections.Generic; namespace Microsoft.Iris.Library { - public struct TreeNodeEnumerator : IEnumerator + public struct TreeNodeEnumerator : IEnumerator { private TreeNode _nodeParent; private TreeNode _nodeCurrent; @@ -39,5 +40,9 @@ namespace Microsoft.Iris.Library _nodeNext = _nodeNext.NextSibling; return true; } + + public void Dispose() + { + } } }