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

                rwLock.AcquireWriterLock(timeout);

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

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