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