/// <summary> /// Creates a synchronized (thread-safe) wrapper for a /// <c>PaymentTypeCollection</c> instance. /// </summary> /// <returns> /// An <c>PaymentTypeCollection</c> wrapper that is synchronized (thread-safe). /// </returns> public static PaymentTypeCollection Synchronized(PaymentTypeCollection list) { if (list == null) { throw new ArgumentNullException("list"); } return(new SyncPaymentTypeCollection(list)); }
/// <summary> /// Creates a read-only wrapper for a /// <c>PaymentTypeCollection</c> instance. /// </summary> /// <returns> /// An <c>PaymentTypeCollection</c> wrapper that is read-only. /// </returns> public static PaymentTypeCollection ReadOnly(PaymentTypeCollection list) { if (list == null) { throw new ArgumentNullException("list"); } return(new ReadOnlyPaymentTypeCollection(list)); }
/// <summary> /// Creates a shallow copy of the <see cref="PaymentTypeCollection"/>. /// </summary> public virtual object Clone() { PaymentTypeCollection newColl = new PaymentTypeCollection(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); }
/// <summary> /// Converts the array of integer values to a <c>PaymentTypeCollection</c>. /// </summary> /// <param name="x"></param> /// <returns></returns> public static PaymentTypeCollection ConvertToCollection(int[] x) { PaymentTypeCollection types = new PaymentTypeCollection(x.Length); for (int i = 0; i < x.Length; i++) { types.Add((ePaymentType)x[i]); } return(types); }
/// <summary> /// Adds the elements of another <c>PaymentTypeCollection</c> to the current <c>PaymentTypeCollection</c>. /// </summary> /// <param name="x">The <c>PaymentTypeCollection</c> whose elements should be added to the end of the current <c>PaymentTypeCollection</c>.</param> /// <returns>The new <see cref="PaymentTypeCollection.Count"/> of the <c>PaymentTypeCollection</c>.</returns> public virtual int AddRange(PaymentTypeCollection 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); }
public override int AddRange(PaymentTypeCollection x) { int result = 0; rwLock.AcquireWriterLock(timeout); try { result = collection.AddRange(x); } finally { rwLock.ReleaseWriterLock(); } return(result); }
internal SyncPaymentTypeCollection(PaymentTypeCollection list) : base(Tag.Default) { rwLock = new System.Threading.ReaderWriterLock(); collection = list; }
/// <summary> /// Initializes a new instance of the <c>Enumerator</c> class. /// </summary> /// <param name="tc"></param> internal Enumerator(PaymentTypeCollection tc) { m_collection = tc; m_index = -1; m_version = tc.m_version; }
/// <summary> /// Initializes a new instance of the <c>PaymentTypeCollection</c> class /// that contains elements copied from the specified <c>PaymentTypeCollection</c>. /// </summary> /// <param name="c">The <c>PaymentTypeCollection</c> whose elements are copied to the new collection.</param> public PaymentTypeCollection(PaymentTypeCollection c) { m_array = new ePaymentType[c.Count]; AddRange(c); }
public override int AddRange(PaymentTypeCollection x) { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); }
internal ReadOnlyPaymentTypeCollection(PaymentTypeCollection list) : base(Tag.Default) { m_collection = list; }