Example #1
0
        public static AppenderCollection ReadOnly(AppenderCollection list)
        {
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }

            return(new ReadOnlyAppenderCollection(list));
        }
Example #2
0
        public virtual object Clone()
        {
            AppenderCollection newCol = new AppenderCollection(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);
        }
Example #3
0
        public virtual int AddRange(AppenderCollection 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 void AddAppender(IAppender newAppender)
        {
            // Null values for newAppender parameter are strictly forbidden.
            if (newAppender == null)
            {
                throw new ArgumentNullException("newAppender");
            }

            m_appenderArray = null;
            if (m_appenderList == null)
            {
                m_appenderList = new AppenderCollection(1);
            }
            if (!m_appenderList.Contains(newAppender))
            {
                m_appenderList.Add(newAppender);
            }
        }
Example #5
0
 internal Enumerator(AppenderCollection tc)
 {
     m_collection = tc;
     m_index      = -1;
     m_version    = tc.m_version;
 }
Example #6
0
 public override int AddRange(AppenderCollection x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
Example #7
0
 internal ReadOnlyAppenderCollection(AppenderCollection list) : base(Tag.Default)
 {
     m_collection = list;
 }
Example #8
0
 public AppenderCollection(AppenderCollection c)
 {
     m_array = new IAppender[c.Count];
     AddRange(c);
 }