Esempio n. 1
0
 /// <summary>
 ///		Creates a read-only wrapper for a
 ///     <c>FloatCollection</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>FloatCollection</c> wrapper that is read-only.
 /// </returns>
 public static FloatCollection ReadOnly(FloatCollection list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new ReadOnlyFloatCollection(list));
 }
Esempio n. 2
0
 /// <summary>
 ///		Creates a synchronized (thread-safe) wrapper for a
 ///     <c>FloatCollection</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>FloatCollection</c> wrapper that is synchronized (thread-safe).
 /// </returns>
 public static FloatCollection Synchronized(FloatCollection list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new SyncFloatCollection(list));
 }
Esempio n. 3
0
        /// <summary>
        ///	Creates a deep copy of the <see cref="FloatCollection"/>.
        /// </summary>
        public virtual FloatCollection Clone()
        {
            FloatCollection newColl = new FloatCollection(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);
        }
Esempio n. 4
0
        /// <summary>
        ///		Adds the elements of another <c>FloatCollection</c> to the current <c>FloatCollection</c>.
        /// </summary>
        /// <param name="x">The <c>FloatCollection</c> whose elements should be added to the end of the current <c>FloatCollection</c>.</param>
        /// <returns>The new <see cref="FloatCollection.Count"/> of the <c>FloatCollection</c>.</returns>
        public virtual int AddRange(FloatCollection 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);
        }
Esempio n. 5
0
            public override int AddRange(FloatCollection x)
            {
                int result = 0;

                rwLock.AcquireWriterLock(timeout);

                try
                {
                    result = collection.AddRange(x);
                }
                finally
                {
                    rwLock.ReleaseWriterLock();
                }

                return(result);
            }
Esempio n. 6
0
 /// <summary>
 ///		Initializes a new instance of the <c>FloatCollection</c> class
 ///		that contains elements copied from the specified <c>FloatCollection</c>.
 /// </summary>
 /// <param name="c">The <c>FloatCollection</c> whose elements are copied to the new collection.</param>
 public FloatCollection(FloatCollection c)
 {
     m_array = new float[c.Count];
     AddRange(c);
 }
Esempio n. 7
0
 internal SyncFloatCollection(FloatCollection list) : base(Tag.Default)
 {
     rwLock     = new System.Threading.ReaderWriterLock();
     collection = list;
 }
Esempio n. 8
0
 /// <summary>
 ///		Initializes a new instance of the <c>FloatEnumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal FloatEnumerator(FloatCollection tc)
 {
     m_collection = tc;
     m_index      = -1;
     m_version    = tc.m_version;
 }
Esempio n. 9
0
 public override int AddRange(FloatCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Esempio n. 10
0
 internal ReadOnlyFloatCollection(FloatCollection list) : base(Tag.Default)
 {
     m_collection = list;
 }