You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewInvalidOperationException("Adding a child node more than once.");
121
-
thrownewInvalidOperationException("Adding a node that belongs to another parent.");
122
-
}
123
-
124
175
AssertNotRecycled();
176
+
AssertOkToJoinFamily(child);
177
+
125
178
EnsureChildrenMapped();// Adding to potentially existing nodes.
126
-
node.Parent=this;
127
-
_children.Add(node);
179
+
child.Parent=this;
180
+
_children.Add(child);
128
181
}
129
182
130
183
/// <inheritdoc />
@@ -140,7 +193,7 @@ public void Clear()
140
193
}
141
194
142
195
/// <inheritdoc />
143
-
publicintCount=>_children.Count;
196
+
publicintCount=>EnsureChildrenMapped().Count;
144
197
145
198
/// <inheritdoc />
146
199
publicIEnumerator<Node<T>>GetEnumerator()
@@ -157,15 +210,17 @@ public void CopyTo(Node<T>[] array, int arrayIndex)
157
210
_children.CopyTo(array,arrayIndex);
158
211
}
159
212
#endregion
213
+
#endregion
160
214
161
215
/// <summary>
162
216
/// Gets a new node with the provided value and adds it as a child.
163
217
/// </summary>
164
218
/// <param name="value">The value of the new child.</param>
165
-
publicvoidAddValue(Tvalue)
219
+
/// <param name="asUnmapped">If true adds the node if it has been prepared for mapping but not yet checked if the value is an IParent. If value is not an IParent, then this flag does nothing.</param>
0 commit comments