using System;
using System.Xml;
using System.Collections;
namespace WWB.Rss
{
#region IRssItem interface
///
/// Decorator Interface for an RSS Item
///
public interface IRssItem
{
///
/// Gets the title element data of the item.
///
string Title
{
get;
}
///
/// Gets the link element data of the item.
///
string Link
{
get;
}
///
/// Gets the description of the item.
///
string Description
{
get;
}
///
/// Gets the pubDate of the item.
///
DateTime PubDate
{
get;
}
///
/// Gets the author of the item.
///
string Author
{
get;
}
///
/// Gets the GUID of the item.
///
string Guid
{
get;
}
}
#endregion
#region Rss Feed class
///
/// Summary description for RssFeed.
///
public class RssFeed
{
#region fields
string title=string.Empty;
string link=string.Empty;
string description=string.Empty;
string language="en-us";
string webmaster=string.Empty;
DateTime pubDate=DateTime.Now;
IRssItemCollection items=new IRssItemCollection();
XmlDocument rss=null;
int ttl;
string managingeditor=string.Empty;
private const string RSSVERSION="2.0";
#endregion
#region public properties
public string Title
{
get {return this.title;}
set {this.title=value;}
}
public string Link
{
get {return this.link;}
set {this.link=value;}
}
public string Description
{
get {return this.description;}
set {this.description=value;}
}
public string Language
{
get {return this.language;}
set {this.language=value;}
}
public string Webmaster
{
get {return this.webmaster;}
set {this.webmaster=value;}
}
public DateTime PubDate
{
get {return this.pubDate;}
set {this.pubDate=value;}
}
public IRssItemCollection Items
{
get {return this.items;}
}
public XmlDocument Rss
{
get
{
if (this.rss==null)
{
this.BuildRss();
}
return this.rss;
}
}
public string ManagingEditor
{
get{return this.managingeditor;}
set{this.managingeditor=value;}
}
public int TTL
{
get {return this.ttl;}
set {this.ttl=value;}
}
#endregion
#region Constructors
public RssFeed()
{}
public RssFeed(IRssItem[] items)
{
this.items=new IRssItemCollection(items);
}
#endregion
#region public methods
///
/// Builds the Rss feed. Called automatically when accessing the Rss property. Call again if the object changes before accessing the Rss property.
///
public void BuildRss()
{
this.rss=new XmlDocument();
//create document element
XmlElement elem=rss.CreateElement("rss");
XmlNode text;
XmlAttribute attrib=rss.CreateAttribute("version");
attrib.Value=RssFeed.RSSVERSION;
elem.Attributes.Append(attrib);
rss.AppendChild(elem);
//create channel
XmlElement channel=rss.CreateElement("channel");
//add stuff to channel starting with title.
elem=rss.CreateElement("title");
text=rss.CreateTextNode(this.title);
elem.AppendChild(text);
channel.AppendChild(elem);
//add link
elem=rss.CreateElement("link");
text=rss.CreateTextNode(this.link);
elem.AppendChild(text);
channel.AppendChild(elem);
//add description
elem=rss.CreateElement("description");
text=rss.CreateTextNode(this.description);
elem.AppendChild(text);
channel.AppendChild(elem);
//add language
elem=rss.CreateElement("language");
text=rss.CreateTextNode(this.language);
elem.AppendChild(text);
channel.AppendChild(elem);
//add pubDate
elem=rss.CreateElement("pubDate");
text=rss.CreateTextNode(this.pubDate.ToString("r"));
elem.AppendChild(text);
channel.AppendChild(elem);
//add managing editor
elem=rss.CreateElement("managingEditor");
text=rss.CreateTextNode(this.managingeditor);
elem.AppendChild(text);
channel.AppendChild(elem);
//add webmaster
elem=rss.CreateElement("webMaster");
text=rss.CreateTextNode(this.webmaster);
elem.AppendChild(text);
channel.AppendChild(elem);
//add the individual items
foreach (IRssItem rssitem in this.items)
{
channel.AppendChild(this.CreateItem(rssitem,this.rss));
}
this.rss.DocumentElement.AppendChild(channel);
}
#endregion
#region private methods
private XmlElement CreateItem(IRssItem item, XmlDocument doc)
{
//build item.
XmlElement itemelement=doc.CreateElement("item");
XmlNode text;
//add title
XmlElement elem=doc.CreateElement("title");
text=doc.CreateTextNode(item.Title);
elem.AppendChild(text);
itemelement.AppendChild(elem);
//add link
elem=doc.CreateElement("link");
text=doc.CreateTextNode(item.Link);
elem.AppendChild(text);
itemelement.AppendChild(elem);
//add description
elem=doc.CreateElement("description");
text=doc.CreateTextNode(item.Description);
elem.AppendChild(text);
itemelement.AppendChild(elem);
//add pubDate
elem=doc.CreateElement("pubDate");
text=doc.CreateTextNode(item.PubDate.ToString("r"));
elem.AppendChild(text);
itemelement.AppendChild(elem);
//add Guid
elem=doc.CreateElement("guid");
text=doc.CreateTextNode(item.Guid);
elem.AppendChild(text);
itemelement.AppendChild(elem);
return itemelement;
}
#endregion
}
#endregion
#region IRssItemCollection
///
/// A strongly-typed collection of objects. Generated using CodeSmith 3.1
///
[Serializable]
public class IRssItemCollection : ICollection, IList, IEnumerable, ICloneable
{
#region Interfaces
///
/// Supports type-safe iteration over a .
///
public interface IIRssItemCollectionEnumerator
{
///
/// Gets the current element in the collection.
///
IRssItem Current {get;}
///
/// Advances the enumerator to the next element in the collection.
///
///
/// The collection was modified after the enumerator was created.
///
///
/// true if the enumerator was successfully advanced to the next element;
/// false if the enumerator has passed the end of the collection.
///
bool MoveNext();
///
/// Sets the enumerator to its initial position, before the first element in the collection.
///
void Reset();
}
#endregion
private const int DEFAULT_CAPACITY = 16;
#region Implementation (data)
private IRssItem[] m_array;
private int m_count = 0;
[NonSerialized]
private int m_version = 0;
#endregion
#region Static Wrappers
///
/// Creates a synchronized (thread-safe) wrapper for a
/// IRssItemCollection instance.
///
///
/// An IRssItemCollection wrapper that is synchronized (thread-safe).
///
public static IRssItemCollection Synchronized(IRssItemCollection list)
{
if(list==null)
throw new ArgumentNullException("list");
return new SyncIRssItemCollection(list);
}
///
/// Creates a read-only wrapper for a
/// IRssItemCollection instance.
///
///
/// An IRssItemCollection wrapper that is read-only.
///
public static IRssItemCollection ReadOnly(IRssItemCollection list)
{
if(list==null)
throw new ArgumentNullException("list");
return new ReadOnlyIRssItemCollection(list);
}
#endregion
#region Construction
///
/// Initializes a new instance of the IRssItemCollection class
/// that is empty and has the default initial capacity.
///
public IRssItemCollection()
{
m_array = new IRssItem[DEFAULT_CAPACITY];
}
///
/// Initializes a new instance of the IRssItemCollection class
/// that has the specified initial capacity.
///
///
/// The number of elements that the new IRssItemCollection is initially capable of storing.
///
public IRssItemCollection(int capacity)
{
m_array = new IRssItem[capacity];
}
///
/// Initializes a new instance of the IRssItemCollection class
/// that contains elements copied from the specified IRssItemCollection.
///
/// The IRssItemCollection whose elements are copied to the new collection.
public IRssItemCollection(IRssItemCollection c)
{
m_array = new IRssItem[c.Count];
AddRange(c);
}
///
/// Initializes a new instance of the IRssItemCollection class
/// that contains elements copied from the specified array.
///
/// The array whose elements are copied to the new list.
public IRssItemCollection(IRssItem[] a)
{
m_array = new IRssItem[a.Length];
AddRange(a);
}
protected enum Tag
{
Default
}
protected IRssItemCollection(Tag t)
{
m_array = null;
}
#endregion
#region Operations (type-safe ICollection)
///
/// Gets the number of elements actually contained in the IRssItemCollection.
///
public virtual int Count
{
get { return m_count; }
}
///
/// Copies the entire IRssItemCollection to a one-dimensional
/// array.
///
/// The one-dimensional array to copy to.
public virtual void CopyTo(IRssItem[] array)
{
this.CopyTo(array, 0);
}
///
/// Copies the entire IRssItemCollection to a one-dimensional
/// array, starting at the specified index of the target array.
///
/// The one-dimensional array to copy to.
/// The zero-based index in at which copying begins.
public virtual void CopyTo(IRssItem[] array, int start)
{
if (m_count > array.GetUpperBound(0) + 1 - start)
throw new System.ArgumentException("Destination array was not long enough.");
Array.Copy(m_array, 0, array, start, m_count);
}
///
/// Gets a value indicating whether access to the collection is synchronized (thread-safe).
///
/// true if access to the ICollection is synchronized (thread-safe); otherwise, false.
public virtual bool IsSynchronized
{
get { return m_array.IsSynchronized; }
}
///
/// Gets an object that can be used to synchronize access to the collection.
///
public virtual object SyncRoot
{
get { return m_array.SyncRoot; }
}
#endregion
#region Operations (type-safe IList)
///
/// Gets or sets the at the specified index.
///
/// The zero-based index of the element to get or set.
///
/// is less than zero
/// -or-
/// is equal to or greater than .
///
public virtual IRssItem this[int index]
{
get
{
ValidateIndex(index); // throws
return m_array[index];
}
set
{
ValidateIndex(index); // throws
++m_version;
m_array[index] = value;
}
}
///
/// Adds a to the end of the IRssItemCollection.
///
/// The to be added to the end of the IRssItemCollection.
/// The index at which the value has been added.
public virtual int Add(IRssItem item)
{
if (m_count == m_array.Length)
EnsureCapacity(m_count + 1);
m_array[m_count] = item;
m_version++;
return m_count++;
}
///
/// Removes all elements from the IRssItemCollection.
///
public virtual void Clear()
{
++m_version;
m_array = new IRssItem[DEFAULT_CAPACITY];
m_count = 0;
}
///
/// Creates a shallow copy of the .
///
public virtual object Clone()
{
IRssItemCollection newColl = new IRssItemCollection(m_count);
Array.Copy(m_array, 0, newColl.m_array, 0, m_count);
newColl.m_count = m_count;
newColl.m_version = m_version;
return newColl;
}
///
/// Determines whether a given is in the IRssItemCollection.
///
/// The to check for.
/// true if is found in the IRssItemCollection; otherwise, false.
public virtual bool Contains(IRssItem item)
{
for (int i=0; i != m_count; ++i)
if (m_array[i].Equals(item))
return true;
return false;
}
///
/// Returns the zero-based index of the first occurrence of a
/// in the IRssItemCollection.
///
/// The to locate in the IRssItemCollection.
///
/// The zero-based index of the first occurrence of
/// in the entire IRssItemCollection, if found; otherwise, -1.
///
public virtual int IndexOf(IRssItem item)
{
for (int i=0; i != m_count; ++i)
if (m_array[i].Equals(item))
return i;
return -1;
}
///
/// Inserts an element into the IRssItemCollection at the specified index.
///
/// The zero-based index at which should be inserted.
/// The to insert.
///
/// is less than zero
/// -or-
/// is equal to or greater than .
///
public virtual void Insert(int index, IRssItem item)
{
ValidateIndex(index, true); // throws
if (m_count == m_array.Length)
EnsureCapacity(m_count + 1);
if (index < m_count)
{
Array.Copy(m_array, index, m_array, index + 1, m_count - index);
}
m_array[index] = item;
m_count++;
m_version++;
}
///
/// Removes the first occurrence of a specific from the IRssItemCollection.
///
/// The to remove from the IRssItemCollection.
///
/// The specified was not found in the IRssItemCollection.
///
public virtual void Remove(IRssItem item)
{
int i = IndexOf(item);
if (i < 0)
throw new System.ArgumentException("Cannot remove the specified item because it was not found in the specified Collection.");
++m_version;
RemoveAt(i);
}
///
/// Removes the element at the specified index of the IRssItemCollection.
///
/// The zero-based index of the element to remove.
///
/// is less than zero
/// -or-
/// is equal to or greater than .
///
public virtual void RemoveAt(int index)
{
ValidateIndex(index); // throws
m_count--;
if (index < m_count)
{
Array.Copy(m_array, index + 1, m_array, index, m_count - index);
}
// We can't set the deleted entry equal to null, because it might be a value type.
// Instead, we'll create an empty single-element array of the right type and copy it
// over the entry we want to erase.
IRssItem[] temp = new IRssItem[1];
Array.Copy(temp, 0, m_array, m_count, 1);
m_version++;
}
///
/// Gets a value indicating whether the collection has a fixed size.
///
/// true if the collection has a fixed size; otherwise, false. The default is false
public virtual bool IsFixedSize
{
get { return false; }
}
///
/// gets a value indicating whether the IList is read-only.
///
/// true if the collection is read-only; otherwise, false. The default is false
public virtual bool IsReadOnly
{
get { return false; }
}
#endregion
#region Operations (type-safe IEnumerable)
///
/// Returns an enumerator that can iterate through the IRssItemCollection.
///
/// An for the entire IRssItemCollection.
public virtual IIRssItemCollectionEnumerator GetEnumerator()
{
return new Enumerator(this);
}
#endregion
#region Public helpers (just to mimic some nice features of ArrayList)
///
/// Gets or sets the number of elements the IRssItemCollection can contain.
///
public virtual int Capacity
{
get { return m_array.Length; }
set
{
if (value < m_count)
value = m_count;
if (value != m_array.Length)
{
if (value > 0)
{
IRssItem[] temp = new IRssItem[value];
Array.Copy(m_array, temp, m_count);
m_array = temp;
}
else
{
m_array = new IRssItem[DEFAULT_CAPACITY];
}
}
}
}
///
/// Adds the elements of another IRssItemCollection to the current IRssItemCollection.
///
/// The IRssItemCollection whose elements should be added to the end of the current IRssItemCollection.
/// The new of the IRssItemCollection.
public virtual int AddRange(IRssItemCollection 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;
}
///
/// Adds the elements of a array to the current IRssItemCollection.
///
/// The array whose elements should be added to the end of the IRssItemCollection.
/// The new of the IRssItemCollection.
public virtual int AddRange(IRssItem[] x)
{
if (m_count + x.Length >= m_array.Length)
EnsureCapacity(m_count + x.Length);
Array.Copy(x, 0, m_array, m_count, x.Length);
m_count += x.Length;
m_version++;
return m_count;
}
///
/// Sets the capacity to the actual number of elements.
///
public virtual void TrimToSize()
{
this.Capacity = m_count;
}
#endregion
#region Implementation (helpers)
///
/// is less than zero
/// -or-
/// is equal to or greater than .
///
private void ValidateIndex(int i)
{
ValidateIndex(i, false);
}
///
/// is less than zero
/// -or-
/// is equal to or greater than .
///
private void ValidateIndex(int i, bool allowEqualEnd)
{
int max = (allowEqualEnd)?(m_count):(m_count-1);
if (i < 0 || i > max)
throw new System.ArgumentOutOfRangeException("Index was out of range. Must be non-negative and less than the size of the collection.", (object)i, "Specified argument was out of the range of valid values.");
}
private void EnsureCapacity(int min)
{
int newCapacity = ((m_array.Length == 0) ? DEFAULT_CAPACITY : m_array.Length * 2);
if (newCapacity < min)
newCapacity = min;
this.Capacity = newCapacity;
}
#endregion
#region Implementation (ICollection)
void ICollection.CopyTo(Array array, int start)
{
this.CopyTo((IRssItem[])array, start);
}
#endregion
#region Implementation (IList)
object IList.this[int i]
{
get { return (object)this[i]; }
set { this[i] = (IRssItem)value; }
}
int IList.Add(object x)
{
return this.Add((IRssItem)x);
}
bool IList.Contains(object x)
{
return this.Contains((IRssItem)x);
}
int IList.IndexOf(object x)
{
return this.IndexOf((IRssItem)x);
}
void IList.Insert(int pos, object x)
{
this.Insert(pos, (IRssItem)x);
}
void IList.Remove(object x)
{
this.Remove((IRssItem)x);
}
void IList.RemoveAt(int pos)
{
this.RemoveAt(pos);
}
#endregion
#region Implementation (IEnumerable)
IEnumerator IEnumerable.GetEnumerator()
{
return (IEnumerator)(this.GetEnumerator());
}
#endregion
#region Nested enumerator class
///
/// Supports simple iteration over a .
///
private class Enumerator : IEnumerator, IIRssItemCollectionEnumerator
{
#region Implementation (data)
private IRssItemCollection m_collection;
private int m_index;
private int m_version;
#endregion
#region Construction
///
/// Initializes a new instance of the Enumerator class.
///
///
internal Enumerator(IRssItemCollection tc)
{
m_collection = tc;
m_index = -1;
m_version = tc.m_version;
}
#endregion
#region Operations (type-safe IEnumerator)
///
/// Gets the current element in the collection.
///
public IRssItem Current
{
get { return m_collection[m_index]; }
}
///
/// Advances the enumerator to the next element in the collection.
///
///
/// The collection was modified after the enumerator was created.
///
///
/// true if the enumerator was successfully advanced to the next element;
/// false if the enumerator has passed the end of the collection.
///
public bool MoveNext()
{
if (m_version != m_collection.m_version)
throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute.");
++m_index;
return (m_index < m_collection.Count) ? true : false;
}
///
/// Sets the enumerator to its initial position, before the first element in the collection.
///
public void Reset()
{
m_index = -1;
}
#endregion
#region Implementation (IEnumerator)
object IEnumerator.Current
{
get { return (object)(this.Current); }
}
#endregion
}
#endregion
#region Nested Syncronized Wrapper class
[Serializable]
private class SyncIRssItemCollection : IRssItemCollection, System.Runtime.Serialization.IDeserializationCallback
{
#region Implementation (data)
private const int timeout = 0; // infinite
private IRssItemCollection collection;
[NonSerialized]
private System.Threading.ReaderWriterLock rwLock;
#endregion
#region Construction
internal SyncIRssItemCollection(IRssItemCollection list) : base(Tag.Default)
{
rwLock = new System.Threading.ReaderWriterLock();
collection = list;
}
#endregion
#region IDeserializationCallback Members
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object sender)
{
rwLock = new System.Threading.ReaderWriterLock();
}
#endregion
#region Type-safe ICollection
public override void CopyTo(IRssItem[] array)
{
rwLock.AcquireReaderLock(timeout);
try
{
collection.CopyTo(array);
}
finally
{
rwLock.ReleaseReaderLock();
}
}
public override void CopyTo(IRssItem[] array, int start)
{
rwLock.AcquireReaderLock(timeout);
try
{
collection.CopyTo(array, start);
}
finally
{
rwLock.ReleaseReaderLock();
}
}
public override int Count
{
get
{
int count = 0;
rwLock.AcquireReaderLock(timeout);
try
{
count = collection.Count;
}
finally
{
rwLock.ReleaseReaderLock();
}
return count;
}
}
public override bool IsSynchronized
{
get { return true; }
}
public override object SyncRoot
{
get { return collection.SyncRoot; }
}
#endregion
#region Type-safe IList
public override IRssItem this[int i]
{
get
{
IRssItem thisItem;
rwLock.AcquireReaderLock(timeout);
try
{
thisItem = collection[i];
}
finally
{
rwLock.ReleaseReaderLock();
}
return thisItem;
}
set
{
rwLock.AcquireWriterLock(timeout);
try
{
collection[i] = value;
}
finally
{
rwLock.ReleaseWriterLock();
}
}
}
public override int Add(IRssItem x)
{
int result = 0;
rwLock.AcquireWriterLock(timeout);
try
{
result = collection.Add(x);
}
finally
{
rwLock.ReleaseWriterLock();
}
return result;
}
public override void Clear()
{
rwLock.AcquireWriterLock(timeout);
try
{
collection.Clear();
}
finally
{
rwLock.ReleaseWriterLock();
}
}
public override bool Contains(IRssItem x)
{
bool result = false;
rwLock.AcquireReaderLock(timeout);
try
{
result = collection.Contains(x);
}
finally
{
rwLock.ReleaseReaderLock();
}
return result;
}
public override int IndexOf(IRssItem x)
{
int result = 0;
rwLock.AcquireReaderLock(timeout);
try
{
result = collection.IndexOf(x);
}
finally
{
rwLock.ReleaseReaderLock();
}
return result;
}
public override void Insert(int pos, IRssItem x)
{
rwLock.AcquireWriterLock(timeout);
try
{
collection.Insert(pos,x);
}
finally
{
rwLock.ReleaseWriterLock();
}
}
public override void Remove(IRssItem x)
{
rwLock.AcquireWriterLock(timeout);
try
{
collection.Remove(x);
}
finally
{
rwLock.ReleaseWriterLock();
}
}
public override void RemoveAt(int pos)
{
rwLock.AcquireWriterLock(timeout);
try
{
collection.RemoveAt(pos);
}
finally
{
rwLock.ReleaseWriterLock();
}
}
public override bool IsFixedSize
{
get { return collection.IsFixedSize; }
}
public override bool IsReadOnly
{
get { return collection.IsReadOnly; }
}
#endregion
#region Type-safe IEnumerable
public override IIRssItemCollectionEnumerator GetEnumerator()
{
IIRssItemCollectionEnumerator enumerator = null;
rwLock.AcquireReaderLock(timeout);
try
{
enumerator = collection.GetEnumerator();
}
finally
{
rwLock.ReleaseReaderLock();
}
return enumerator;
}
#endregion
#region Public Helpers
// (just to mimic some nice features of ArrayList)
public override int Capacity
{
get
{
int result = 0;
rwLock.AcquireReaderLock(timeout);
try
{
result = collection.Capacity;
}
finally
{
rwLock.ReleaseReaderLock();
}
return result;
}
set
{
rwLock.AcquireWriterLock(timeout);
try
{
collection.Capacity = value;
}
finally
{
rwLock.ReleaseWriterLock();
}
}
}
public override int AddRange(IRssItemCollection x)
{
int result = 0;
rwLock.AcquireWriterLock(timeout);
try
{
result = collection.AddRange(x);
}
finally
{
rwLock.ReleaseWriterLock();
}
return result;
}
public override int AddRange(IRssItem[] x)
{
int result = 0;
rwLock.AcquireWriterLock(timeout);
try
{
result = collection.AddRange(x);
}
finally
{
rwLock.ReleaseWriterLock();
}
return result;
}
#endregion
}
#endregion
#region Nested Read Only Wrapper class
private class ReadOnlyIRssItemCollection : IRssItemCollection
{
#region Implementation (data)
private IRssItemCollection m_collection;
#endregion
#region Construction
internal ReadOnlyIRssItemCollection(IRssItemCollection list) : base(Tag.Default)
{
m_collection = list;
}
#endregion
#region Type-safe ICollection
public override void CopyTo(IRssItem[] array)
{
m_collection.CopyTo(array);
}
public override void CopyTo(IRssItem[] array, int start)
{
m_collection.CopyTo(array,start);
}
public override int Count
{
get { return m_collection.Count; }
}
public override bool IsSynchronized
{
get { return m_collection.IsSynchronized; }
}
public override object SyncRoot
{
get { return this.m_collection.SyncRoot; }
}
#endregion
#region Type-safe IList
public override IRssItem this[int i]
{
get { return m_collection[i]; }
set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); }
}
public override int Add(IRssItem x)
{
throw new NotSupportedException("This is a Read Only Collection and can not be modified");
}
public override void Clear()
{
throw new NotSupportedException("This is a Read Only Collection and can not be modified");
}
public override bool Contains(IRssItem x)
{
return m_collection.Contains(x);
}
public override int IndexOf(IRssItem x)
{
return m_collection.IndexOf(x);
}
public override void Insert(int pos, IRssItem x)
{
throw new NotSupportedException("This is a Read Only Collection and can not be modified");
}
public override void Remove(IRssItem x)
{
throw new NotSupportedException("This is a Read Only Collection and can not be modified");
}
public override void RemoveAt(int pos)
{
throw new NotSupportedException("This is a Read Only Collection and can not be modified");
}
public override bool IsFixedSize
{
get {return true;}
}
public override bool IsReadOnly
{
get {return true;}
}
#endregion
#region Type-safe IEnumerable
public override IIRssItemCollectionEnumerator GetEnumerator()
{
return m_collection.GetEnumerator();
}
#endregion
#region Public Helpers
// (just to mimic some nice features of ArrayList)
public override int Capacity
{
get { return m_collection.Capacity; }
set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); }
}
public override int AddRange(IRssItemCollection x)
{
throw new NotSupportedException("This is a Read Only Collection and can not be modified");
}
public override int AddRange(IRssItem[] x)
{
throw new NotSupportedException("This is a Read Only Collection and can not be modified");
}
#endregion
}
#endregion
}
#endregion
}