Exemple #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));
 }
Exemple #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));
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #5
0
            public override int AddRange(StatementPhoneNumberCollection x)
            {
                int result = 0;

                rwLock.AcquireWriterLock(timeout);

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

                return(result);
            }
Exemple #6
0
 internal SyncStatementPhoneNumberCollection(StatementPhoneNumberCollection list) : base(Tag.Default)
 {
     rwLock     = new System.Threading.ReaderWriterLock();
     collection = list;
 }
Exemple #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;
 }
Exemple #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);
 }
Exemple #9
0
 public override int AddRange(StatementPhoneNumberCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Exemple #10
0
 internal ReadOnlyStatementPhoneNumberCollection(StatementPhoneNumberCollection list) : base(Tag.Default)
 {
     m_collection = list;
 }