/// <summary>
 ///		Creates a read-only wrapper for a
 ///     <c>QuaternionCollection</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>QuaternionCollection</c> wrapper that is read-only.
 /// </returns>
 public static QuaternionCollection ReadOnly(QuaternionCollection list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new ReadOnlyQuaternionCollection(list));
 }
 /// <summary>
 ///		Creates a synchronized (thread-safe) wrapper for a
 ///     <c>QuaternionCollection</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>QuaternionCollection</c> wrapper that is synchronized (thread-safe).
 /// </returns>
 public static QuaternionCollection Synchronized(QuaternionCollection list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new SyncQuaternionCollection(list));
 }
        /// <summary>
        ///		Creates a shallow copy of the <see cref="QuaternionCollection"/>.
        /// </summary>
        virtual public object Clone()
        {
            QuaternionCollection newColl = new QuaternionCollection(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>QuaternionCollection</c> to the current <c>QuaternionCollection</c>.
        /// </summary>
        /// <param name="x">The <c>QuaternionCollection</c> whose elements should be added to the end of the current <c>QuaternionCollection</c>.</param>
        /// <returns>The new <see cref="QuaternionCollection.Count"/> of the <c>QuaternionCollection</c>.</returns>
        virtual public int AddRange(QuaternionCollection 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);
        }
 internal ReadOnlyQuaternionCollection(QuaternionCollection list)
     : base(Tag.Default)
 {
     m_collection = list;
 }
 public override int AddRange(QuaternionCollection x)
 {
     lock (this.m_root) return(m_collection.AddRange(x));
 }
 internal SyncQuaternionCollection(QuaternionCollection list)
     : base(Tag.Default)
 {
     m_root       = list.SyncRoot;
     m_collection = list;
 }
 /// <summary>
 ///		Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(QuaternionCollection tc)
 {
     m_collection = tc;
     m_index      = -1;
     m_version    = tc.m_version;
 }
 /// <summary>
 ///		Initializes a new instance of the <c>QuaternionCollection</c> class
 ///		that contains elements copied from the specified <c>QuaternionCollection</c>.
 /// </summary>
 /// <param name="c">The <c>QuaternionCollection</c> whose elements are copied to the new collection.</param>
 public QuaternionCollection(QuaternionCollection c)
 {
     m_array = new Quaternion[c.Count];
     AddRange(c);
 }
 public override int AddRange(QuaternionCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }