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

            return new ReadOnlyLevelCollection(list);
        }
Пример #2
0
 /// <summary>
 /// Creates a read-only wrapper for a <c>LevelCollection</c> instance.
 /// </summary>
 /// <param name="list">list to create a readonly wrapper arround</param>
 /// <returns>
 /// A <c>LevelCollection</c> wrapper that is read-only.
 /// </returns>
 public static LevelCollection ReadOnly(LevelCollection list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new ReadOnlyLevelCollection(list));
 }
Пример #3
0
        public virtual object Clone()
        {
            LevelCollection levels = new LevelCollection(this.m_count);

            Array.Copy(this.m_array, 0, levels.m_array, 0, this.m_count);
            levels.m_count   = this.m_count;
            levels.m_version = this.m_version;
            return(levels);
        }
Пример #4
0
        /// <summary>
        /// Creates a shallow copy of the <see cref="T:log4net.Core.LevelCollection" />.
        /// </summary>
        /// <returns>A new <see cref="T:log4net.Core.LevelCollection" /> with a shallow copy of the collection data.</returns>
        public virtual object Clone()
        {
            LevelCollection levelCollection = new LevelCollection(m_count);

            Array.Copy(m_array, 0, levelCollection.m_array, 0, m_count);
            levelCollection.m_count   = m_count;
            levelCollection.m_version = m_version;
            return(levelCollection);
        }
Пример #5
0
        /// <summary>
        /// Creates a shallow copy of the <see cref="LevelCollection"/>.
        /// </summary>
        /// <returns>A new <see cref="LevelCollection"/> with a shallow copy of the collection data.</returns>
        public virtual object Clone()
        {
            LevelCollection newCol = new LevelCollection(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);
        }
Пример #6
0
 /// <summary>
 /// Adds the elements of another <c>LevelCollection</c> to the current <c>LevelCollection</c>.
 /// </summary>
 /// <param name="x">The <c>LevelCollection</c> whose elements should be added to the end of the current <c>LevelCollection</c>.</param>
 /// <returns>The new <see cref="P:log4net.Core.LevelCollection.Count" /> of the <c>LevelCollection</c>.</returns>
 public virtual int AddRange(LevelCollection 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);
 }
Пример #7
0
 public virtual int AddRange(LevelCollection x)
 {
     if ((this.m_count + x.Count) >= this.m_array.Length)
     {
         this.EnsureCapacity(this.m_count + x.Count);
     }
     Array.Copy(x.m_array, 0, this.m_array, this.m_count, x.Count);
     this.m_count += x.Count;
     this.m_version++;
     return(this.m_count);
 }
Пример #8
0
			/// <summary>
			/// Initializes a new instance of the <c>Enumerator</c> class.
			/// </summary>
			/// <param name="tc"></param>
			internal Enumerator(LevelCollection tc)
			{
				m_collection = tc;
				m_index = -1;
				m_version = tc.m_version;
			}
Пример #9
0
		/// <summary>
		/// Adds the elements of another <c>LevelCollection</c> to the current <c>LevelCollection</c>.
		/// </summary>
		/// <param name="x">The <c>LevelCollection</c> whose elements should be added to the end of the current <c>LevelCollection</c>.</param>
		/// <returns>The new <see cref="LevelCollection.Count"/> of the <c>LevelCollection</c>.</returns>
		public virtual int AddRange(LevelCollection 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="LevelCollection"/>.
		/// </summary>
		/// <returns>A new <see cref="LevelCollection"/> with a shallow copy of the collection data.</returns>
		public virtual object Clone()
		{
			LevelCollection newCol = new LevelCollection(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
		/// <summary>
		/// Initializes a new instance of the <c>LevelCollection</c> class
		/// that contains elements copied from the specified <c>LevelCollection</c>.
		/// </summary>
		/// <param name="c">The <c>LevelCollection</c> whose elements are copied to the new collection.</param>
		public LevelCollection(LevelCollection c)
		{
			m_array = new Level[c.Count];
			AddRange(c);
		}
Пример #12
0
 public override int AddRange(LevelCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Пример #13
0
 internal ReadOnlyLevelCollection(LevelCollection list) : base(Tag.Default)
 {
     m_collection = list;
 }
Пример #14
0
 /// <summary>
 /// Initializes a new instance of the <c>LevelCollection</c> class
 /// that contains elements copied from the specified <c>LevelCollection</c>.
 /// </summary>
 /// <param name="c">The <c>LevelCollection</c> whose elements are copied to the new collection.</param>
 public LevelCollection(LevelCollection c)
 {
     m_array = new Level[c.Count];
     AddRange(c);
 }
Пример #15
0
 public LevelCollection(LevelCollection c)
 {
     this.m_array = new Level[c.Count];
     this.AddRange(c);
 }
Пример #16
0
			internal ReadOnlyLevelCollection(LevelCollection list) : base(Tag.Default)
			{
				m_collection = list;
			}
Пример #17
0
			public override int AddRange(LevelCollection x)
			{
				throw new NotSupportedException("This is a Read Only Collection and can not be modified");
			}
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(LevelCollection tc)
 {
     m_collection = tc;
     m_index      = -1;
     m_version    = tc.m_version;
 }