public LocalTopic(LocalNamespace ns, string name, string version, string basedOnVersion) { this.ns = ns; this.name = name; this.version = version; this.basedOnVersion = basedOnVersion; }
public ProgressEventArgs(EventType eventType, LocalNamespace ns, LocalTopic topic, Status oldStatus, Status newStatus) { this.eventType = eventType; this.ns = ns; this.topic = topic; this.oldStatus = oldStatus; this.newStatus = newStatus; }
/// <summary> /// Removes the first occurrence of a specific <see cref="LocalNamespace"/> from the <c>LocalNamespaceListBase</c>. /// </summary> /// <param name="item">The <see cref="LocalNamespace"/> to remove from the <c>LocalNamespaceListBase</c>.</param> /// <exception cref="ArgumentException"> /// The specified <see cref="LocalNamespace"/> was not found in the <c>LocalNamespaceListBase</c>. /// </exception> public virtual void Remove(LocalNamespace item) { int i = IndexOf(item); if (i < 0) throw new System.ArgumentException("Cannot remove the specified item because it was not found in the specified Collection."); ++m_version; RemoveAt(i); }
/// <summary> /// Inserts an element into the <c>LocalNamespaceListBase</c> at the specified index. /// </summary> /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param> /// <param name="item">The <see cref="LocalNamespace"/> to insert.</param> /// <exception cref="ArgumentOutOfRangeException"> /// <para><paramref name="index"/> is less than zero</para> /// <para>-or-</para> /// <para><paramref name="index"/> is equal to or greater than <see cref="LocalNamespaceListBase.Count"/>.</para> /// </exception> public virtual void Insert(int index, LocalNamespace item) { ValidateIndex(index, true); // throws if (m_count == m_array.Length) EnsureCapacity(m_count + 1); if (index < m_count) { Array.Copy(m_array, index, m_array, index + 1, m_count - index); } m_array[index] = item; m_count++; m_version++; }
public ProgressEventArgs(EventType eventType, LocalNamespace ns) : this(eventType, ns, null, Status.NoLocalFile, Status.NoLocalFile) { }
public override void CopyTo(LocalNamespace[] array) { m_collection.CopyTo(array); }
public override void Remove(LocalNamespace x) { rwLock.AcquireWriterLock(timeout); try { collection.Remove(x); } finally { rwLock.ReleaseWriterLock(); } }
public override int IndexOf(LocalNamespace x) { int result = 0; rwLock.AcquireReaderLock(timeout); try { result = collection.IndexOf(x); } finally { rwLock.ReleaseReaderLock(); } return result; }
public override void CopyTo(LocalNamespace[] array, int start) { rwLock.AcquireReaderLock(timeout); try { collection.CopyTo(array, start); } finally { rwLock.ReleaseReaderLock(); } }
/// <summary> /// Initializes a new instance of the <c>LocalNamespaceListBase</c> class /// that contains elements copied from the specified <see cref="LocalNamespace"/> array. /// </summary> /// <param name="a">The <see cref="LocalNamespace"/> array whose elements are copied to the new list.</param> public LocalNamespaceListBase(LocalNamespace[] a) { m_array = new LocalNamespace[a.Length]; AddRange(a); }
public override int AddRange(LocalNamespace[] x) { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); }
public override void Remove(LocalNamespace x) { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); }
public override int IndexOf(LocalNamespace x) { return m_collection.IndexOf(x); }
public override bool Contains(LocalNamespace x) { return m_collection.Contains(x); }
/// <summary> /// Removes the element at the specified index of the <c>LocalNamespaceListBase</c>. /// </summary> /// <param name="index">The zero-based index of the element to remove.</param> /// <exception cref="ArgumentOutOfRangeException"> /// <para><paramref name="index"/> is less than zero</para> /// <para>-or-</para> /// <para><paramref name="index"/> is equal to or greater than <see cref="LocalNamespaceListBase.Count"/>.</para> /// </exception> public virtual void RemoveAt(int index) { ValidateIndex(index); // throws m_count--; if (index < m_count) { Array.Copy(m_array, index + 1, m_array, index, m_count - index); } // We can't set the deleted entry equal to null, because it might be a value type. // Instead, we'll create an empty single-element array of the right type and copy it // over the entry we want to erase. LocalNamespace[] temp = new LocalNamespace[1]; Array.Copy(temp, 0, m_array, m_count, 1); m_version++; }
/// <summary> /// Adds the elements of a <see cref="LocalNamespace"/> array to the current <c>LocalNamespaceListBase</c>. /// </summary> /// <param name="x">The <see cref="LocalNamespace"/> array whose elements should be added to the end of the <c>LocalNamespaceListBase</c>.</param> /// <returns>The new <see cref="LocalNamespaceListBase.Count"/> of the <c>LocalNamespaceListBase</c>.</returns> public virtual int AddRange(LocalNamespace[] x) { if (m_count + x.Length >= m_array.Length) EnsureCapacity(m_count + x.Length); Array.Copy(x, 0, m_array, m_count, x.Length); m_count += x.Length; m_version++; return m_count; }
/// <summary> /// Copies the entire <c>LocalNamespaceListBase</c> to a one-dimensional /// <see cref="LocalNamespace"/> array. /// </summary> /// <param name="array">The one-dimensional <see cref="LocalNamespace"/> array to copy to.</param> public virtual void CopyTo(LocalNamespace[] array) { this.CopyTo(array, 0); }
public override bool Contains(LocalNamespace x) { bool result = false; rwLock.AcquireReaderLock(timeout); try { result = collection.Contains(x); } finally { rwLock.ReleaseReaderLock(); } return result; }
/// <summary> /// Copies the entire <c>LocalNamespaceListBase</c> to a one-dimensional /// <see cref="LocalNamespace"/> array, starting at the specified index of the target array. /// </summary> /// <param name="array">The one-dimensional <see cref="LocalNamespace"/> array to copy to.</param> /// <param name="start">The zero-based index in <paramref name="array"/> at which copying begins.</param> public virtual void CopyTo(LocalNamespace[] array, int start) { if (m_count > array.GetUpperBound(0) + 1 - start) throw new System.ArgumentException("Destination array was not long enough."); Array.Copy(m_array, 0, array, start, m_count); }
public override void Insert(int pos, LocalNamespace x) { rwLock.AcquireWriterLock(timeout); try { collection.Insert(pos,x); } finally { rwLock.ReleaseWriterLock(); } }
/// <summary> /// Adds a <see cref="LocalNamespace"/> to the end of the <c>LocalNamespaceListBase</c>. /// </summary> /// <param name="item">The <see cref="LocalNamespace"/> to be added to the end of the <c>LocalNamespaceListBase</c>.</param> /// <returns>The index at which the value has been added.</returns> public virtual int Add(LocalNamespace item) { if (m_count == m_array.Length) EnsureCapacity(m_count + 1); m_array[m_count] = item; m_version++; return m_count++; }
public override int AddRange(LocalNamespace[] x) { int result = 0; rwLock.AcquireWriterLock(timeout); try { result = collection.AddRange(x); } finally { rwLock.ReleaseWriterLock(); } return result; }
/// <summary> /// Determines whether a given <see cref="LocalNamespace"/> is in the <c>LocalNamespaceListBase</c>. /// </summary> /// <param name="item">The <see cref="LocalNamespace"/> to check for.</param> /// <returns><c>true</c> if <paramref name="item"/> is found in the <c>LocalNamespaceListBase</c>; otherwise, <c>false</c>.</returns> public virtual bool Contains(LocalNamespace item) { for (int i=0; i != m_count; ++i) if (m_array[i].Equals(item)) return true; return false; }
public override void CopyTo(LocalNamespace[] array, int start) { m_collection.CopyTo(array,start); }
/// <summary> /// Returns the zero-based index of the first occurrence of a <see cref="LocalNamespace"/> /// in the <c>LocalNamespaceListBase</c>. /// </summary> /// <param name="item">The <see cref="LocalNamespace"/> to locate in the <c>LocalNamespaceListBase</c>.</param> /// <returns> /// The zero-based index of the first occurrence of <paramref name="item"/> /// in the entire <c>LocalNamespaceListBase</c>, if found; otherwise, -1. /// </returns> public virtual int IndexOf(LocalNamespace item) { for (int i=0; i != m_count; ++i) if (m_array[i].Equals(item)) return i; return -1; }