Esempio n. 1
0
 public LocalTopic(LocalNamespace ns, string name, string version, string basedOnVersion)
 {
   this.ns = ns; 
   this.name = name; 
   this.version = version; 
   this.basedOnVersion = basedOnVersion; 
 }
Esempio n. 2
0
 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; 
 }
Esempio n. 3
0
		/// <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);
		}
Esempio n. 4
0
		/// <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++;
		}
Esempio n. 5
0
 public ProgressEventArgs(EventType eventType, LocalNamespace ns) :
   this(eventType, ns, null, Status.NoLocalFile, Status.NoLocalFile)
 {
 }
Esempio n. 6
0
			public override void CopyTo(LocalNamespace[] array)
			{
				m_collection.CopyTo(array);
			}
Esempio n. 7
0
			public override void Remove(LocalNamespace x)
			{           
				rwLock.AcquireWriterLock(timeout);

				try
				{
					collection.Remove(x);
				}
				finally
				{
					rwLock.ReleaseWriterLock();
				}
			}
Esempio n. 8
0
			public override int IndexOf(LocalNamespace x)
			{
				int result = 0;
				rwLock.AcquireReaderLock(timeout);

				try
				{
					result = collection.IndexOf(x);
				}
				finally
				{
					rwLock.ReleaseReaderLock();
				}

				return result;
			}
Esempio n. 9
0
			public override void CopyTo(LocalNamespace[] array, int start)
			{
				rwLock.AcquireReaderLock(timeout);

				try
				{
					collection.CopyTo(array, start);
				}
				finally
				{
					rwLock.ReleaseReaderLock();
				}
			}
Esempio n. 10
0
		/// <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);
		}
Esempio n. 11
0
			public override int AddRange(LocalNamespace[] x)
			{
				throw new NotSupportedException("This is a Read Only Collection and can not be modified");
			}
Esempio n. 12
0
			public override void Remove(LocalNamespace x)
			{           
				throw new NotSupportedException("This is a Read Only Collection and can not be modified");
			}
Esempio n. 13
0
			public override int IndexOf(LocalNamespace x)
			{
				return m_collection.IndexOf(x);
			}
Esempio n. 14
0
			public override bool Contains(LocalNamespace x)
			{
				return m_collection.Contains(x);
			}
Esempio n. 15
0
		/// <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++;
		}
Esempio n. 16
0
		/// <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;
		}
Esempio n. 17
0
		/// <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);
		}
Esempio n. 18
0
			public override bool Contains(LocalNamespace x)
			{
				bool result = false;
				rwLock.AcquireReaderLock(timeout);

				try
				{
					result = collection.Contains(x);
				}
				finally
				{
					rwLock.ReleaseReaderLock();
				}

				return result;
			}
Esempio n. 19
0
		/// <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); 
		}
Esempio n. 20
0
			public override void Insert(int pos, LocalNamespace x)
			{
				rwLock.AcquireWriterLock(timeout);

				try
				{
					collection.Insert(pos,x);
				}
				finally
				{
					rwLock.ReleaseWriterLock();
				}
			}
Esempio n. 21
0
		/// <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++;
		}
Esempio n. 22
0
			public override int AddRange(LocalNamespace[] x)
			{
				int result = 0;
				rwLock.AcquireWriterLock(timeout);

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

				return result;
			}
Esempio n. 23
0
		/// <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;
		}
Esempio n. 24
0
			public override void CopyTo(LocalNamespace[] array, int start)
			{
				m_collection.CopyTo(array,start);
			}
Esempio n. 25
0
		/// <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;
		}