/// <summary> /// Initializes a new instance of the <c>EdgeRingCollection</c> class /// that contains elements copied from the specified <c>EdgeRingCollection</c>. /// </summary> /// <param name="edgeRings">The <c>EdgeRingCollection</c> whose elements are copied to the new collection.</param> public EdgeRingCollection(EdgeRingCollection edgeRings) { if (edgeRings == null) { throw new ArgumentNullException("edgeRings"); } m_array = new EdgeRing[edgeRings.Count]; AddRange(edgeRings); }
/// <summary> /// Creates a shallow copy of the <see cref="EdgeRingCollection"/>. /// </summary> public object Clone() { EdgeRingCollection newColl = new EdgeRingCollection(m_count); Array.Copy(m_array, 0, newColl.m_array, 0, m_count); newColl.m_count = m_count; newColl.m_version = m_version; return(newColl); }
/// <summary> /// Adds the elements of another <c>EdgeRingCollection</c> to the current <c>EdgeRingCollection</c>. /// </summary> /// <param name="x">The <c>EdgeRingCollection</c> whose elements should be added to the end of the current <c>EdgeRingCollection</c>.</param> /// <returns>The new <see cref="EdgeRingCollection.Count"/> of the <c>EdgeRingCollection</c>.</returns> public int AddRange(EdgeRingCollection x) { if (m_count + x.Count >= m_array.Length) { EnsureCapacity(m_count + x.Count); } Array.Copy(x.m_array, 0, m_array, m_count, x.Count); m_count += x.Count; m_version++; return(m_count); }
/// <summary> /// Initializes a new instance of the <c>EdgeRingEnumerator</c> class. /// </summary> /// <param name="tc"></param> internal EdgeRingEnumerator(EdgeRingCollection tc) { m_collection = tc; m_index = -1; m_version = tc.m_version; }