コード例 #1
0
ファイル: PluginCollection.cs プロジェクト: Vizzini/netgore
        /// <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 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));
 }
コード例 #3
0
 /// <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));
 }
コード例 #4
0
		/// <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);
		}
コード例 #5
0
ファイル: PluginCollection.cs プロジェクト: bzmework/log4net
        /// <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);
        }
コード例 #6
0
        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);
        }
コード例 #7
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);
        }
コード例 #8
0
ファイル: PluginCollection.cs プロジェクト: bzmework/log4net
 /// <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);
 }
コード例 #9
0
 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);
 }
コード例 #10
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;
			}
コード例 #11
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;
		}
コード例 #12
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;
		}
コード例 #13
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);
		}
コード例 #14
0
 public override int AddRange(PluginCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
コード例 #15
0
 internal ReadOnlyPluginCollection(PluginCollection list) : base(Tag.Default)
 {
     m_collection = list;
 }
コード例 #16
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;
 }
コード例 #17
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);
 }
コード例 #18
0
			internal ReadOnlyPluginCollection(PluginCollection list) : base(Tag.Default)
			{
				m_collection = list;
			}
コード例 #19
0
			internal SyncPluginCollection(PluginCollection list) : base(Tag.Default)
			{
				m_root = list.SyncRoot;
				m_collection = list;
			}
コード例 #20
0
 /// <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);
 }
コード例 #21
0
 internal SyncPluginCollection(PluginCollection list) : base(Tag.Default)
 {
     m_root       = list.SyncRoot;
     m_collection = list;
 }
コード例 #22
0
 public override int AddRange(PluginCollection x)
 {
     lock (this.m_root)
         return(m_collection.AddRange(x));
 }
コード例 #23
0
			public override int AddRange(PluginCollection x)
			{
				throw new NotSupportedException("This is a Read Only Collection and can not be modified");
			}
コード例 #24
0
			public override int AddRange(PluginCollection x)
			{
				lock(this.m_root)
					return m_collection.AddRange(x);
			}