Beispiel #1
0
 /// <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));
 }
Beispiel #2
0
 /// <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));
 }
Beispiel #3
0
        /// <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);
        }
Beispiel #4
0
        /// <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);
        }
Beispiel #5
0
 public override int AddRange(QuaternionCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Beispiel #6
0
 internal ReadOnlyQuaternionCollection(QuaternionCollection list)
     : base(Tag.Default)
 {
     m_collection = list;
 }
Beispiel #7
0
 public override int AddRange(QuaternionCollection x)
 {
     lock (this.m_root) return(m_collection.AddRange(x));
 }
Beispiel #8
0
 internal SyncQuaternionCollection(QuaternionCollection list)
     : base(Tag.Default)
 {
     m_root       = list.SyncRoot;
     m_collection = list;
 }
Beispiel #9
0
 /// <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;
 }
Beispiel #10
0
 /// <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);
 }