/// <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); }
/// <summary> /// Creates a read-only wrapper for a /// <c>PluginCollection</c> instance. /// </summary> /// <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)); }
/// <summary> /// Creates a synchronized (thread-safe) wrapper for a /// <c>PluginCollection</c> instance. /// </summary> /// <returns> /// A <c>PluginCollection</c> wrapper that is synchronized (thread-safe). /// </returns> public static PluginCollection Synchronized(PluginCollection list) { if (list == null) { throw new ArgumentNullException("list"); } return(new SyncPluginCollection(list)); }
/// <summary> /// Creates a synchronized (thread-safe) wrapper for a /// <c>PluginCollection</c> instance. /// </summary> /// <returns> /// A <c>PluginCollection</c> wrapper that is synchronized (thread-safe). /// </returns> public static PluginCollection Synchronized(PluginCollection list) { if(list == null) { throw new ArgumentNullException("list"); } return new SyncPluginCollection(list); }
/// <summary> /// Creates a shallow copy of the <see cref="T:log4net.Plugin.PluginCollection" />. /// </summary> /// <returns>A new <see cref="T:log4net.Plugin.PluginCollection" /> with a shallow copy of the collection data.</returns> public virtual object Clone() { PluginCollection pluginCollection = new PluginCollection(m_count); Array.Copy(m_array, 0, pluginCollection.m_array, 0, m_count); pluginCollection.m_count = m_count; pluginCollection.m_version = m_version; return(pluginCollection); }
public virtual object Clone() { PluginCollection plugins = new PluginCollection(this.m_count); Array.Copy(this.m_array, 0, plugins.m_array, 0, this.m_count); plugins.m_count = this.m_count; plugins.m_version = this.m_version; return(plugins); }
/// <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); }
/// <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="P:log4net.Plugin.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); }
public virtual int AddRange(PluginCollection 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); }
/// <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; }
/// <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; }
/// <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; }
/// <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); }
public override int AddRange(PluginCollection x) { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); }
internal ReadOnlyPluginCollection(PluginCollection list) : base(Tag.Default) { m_collection = list; }
internal SyncPluginCollection(PluginCollection list) : base(Tag.Default) { m_root = list.SyncRoot; m_collection = list; }
/// <summary> /// Initializes a new instance of the <see cref="PluginCollection"/> class. /// 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) { this.m_array = new IPlugin[c.Count]; this.AddRange(c); }
public override int AddRange(PluginCollection x) { lock (this.m_root) return(m_collection.AddRange(x)); }
public override int AddRange(PluginCollection x) { lock(this.m_root) return m_collection.AddRange(x); }