示例#1
0
        /// <summary>
        ///	Creates a read-only wrapper for a <c>PluginCollection</c> instance.
        /// </summary>
        /// <param name="list">list to create a readonly wrapper arround</param>
        /// <returns>
        /// A <c>PluginCollection</c> wrapper that is read-only.
        /// </returns>
        public static PluginCollection ReadOnly(PluginCollection list)
        {
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }

            return(new ReadOnlyPluginCollection(list));
        }
示例#2
0
        /// <summary>
        /// Creates a shallow copy of the <see cref="PluginCollection"/>.
        /// </summary>
        /// <returns>A new <see cref="PluginCollection"/> with a shallow copy of the collection data.</returns>
        public virtual object Clone()
        {
            PluginCollection newCol = new PluginCollection(m_count);

            Array.Copy(m_array, 0, newCol.m_array, 0, m_count);
            newCol.m_count   = m_count;
            newCol.m_version = m_version;

            return(newCol);
        }
示例#3
0
        /// <summary>
        /// Adds the elements of another <c>PluginCollection</c> to the current <c>PluginCollection</c>.
        /// </summary>
        /// <param name="x">The <c>PluginCollection</c> whose elements should be added to the end of the current <c>PluginCollection</c>.</param>
        /// <returns>The new <see cref="PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
        public virtual int AddRange(PluginCollection 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);
        }
示例#4
0
		/// <summary>
		/// Initializes a new instance of the <c>PluginCollection</c> class
		/// that contains elements copied from the specified <c>PluginCollection</c>.
		/// </summary>
		/// <param name="c">The <c>PluginCollection</c> whose elements are copied to the new collection.</param>
		public PluginCollection(PluginCollection c) {
			m_array = new IPlugin[c.Count];
			AddRange(c);
		}
示例#5
0
			public override int AddRange(PluginCollection x) {
				throw new NotSupportedException("This is a Read Only Collection and can not be modified");
			}
示例#6
0
			internal ReadOnlyPluginCollection(PluginCollection list)
				: base(Tag.Default) {
				m_collection = list;
			}
示例#7
0
		/// <summary>
		///	Creates a read-only wrapper for a <c>PluginCollection</c> instance.
		/// </summary>
		/// <param name="list">list to create a readonly wrapper arround</param>
		/// <returns>
		/// A <c>PluginCollection</c> wrapper that is read-only.
		/// </returns>
		public static PluginCollection ReadOnly(PluginCollection list) {
			if (list == null)
				throw new ArgumentNullException("list");

			return new ReadOnlyPluginCollection(list);
		}
示例#8
0
			/// <summary>
			/// Initializes a new instance of the <c>Enumerator</c> class.
			/// </summary>
			/// <param name="tc"></param>
			internal Enumerator(PluginCollection tc) {
				m_collection = tc;
				m_index = -1;
				m_version = tc.m_version;
			}
示例#9
0
		/// <summary>
		/// Adds the elements of another <c>PluginCollection</c> to the current <c>PluginCollection</c>.
		/// </summary>
		/// <param name="x">The <c>PluginCollection</c> whose elements should be added to the end of the current <c>PluginCollection</c>.</param>
		/// <returns>The new <see cref="PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
		public virtual int AddRange(PluginCollection 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;
		}
示例#10
0
		/// <summary>
		/// Creates a shallow copy of the <see cref="PluginCollection"/>.
		/// </summary>
		/// <returns>A new <see cref="PluginCollection"/> with a shallow copy of the collection data.</returns>
		public virtual object Clone() {
			PluginCollection newCol = new PluginCollection(m_count);
			Array.Copy(m_array, 0, newCol.m_array, 0, m_count);
			newCol.m_count = m_count;
			newCol.m_version = m_version;

			return newCol;
		}
示例#11
0
 public override int AddRange(PluginCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
示例#12
0
 internal ReadOnlyPluginCollection(PluginCollection list)
     : base(Tag.Default)
 {
     m_collection = list;
 }
示例#13
0
 /// <summary>
 /// Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(PluginCollection tc)
 {
     m_collection = tc;
     m_index      = -1;
     m_version    = tc.m_version;
 }
示例#14
0
 /// <summary>
 /// Initializes a new instance of the <c>PluginCollection</c> class
 /// that contains elements copied from the specified <c>PluginCollection</c>.
 /// </summary>
 /// <param name="c">The <c>PluginCollection</c> whose elements are copied to the new collection.</param>
 public PluginCollection(PluginCollection c)
 {
     m_array = new IPlugin[c.Count];
     AddRange(c);
 }