?? opmlitemcollection.cs
字號:
}
}
#endregion
#region Class ReadOnlyList
[Serializable]
private sealed class ReadOnlyList : OpmlItemCollection
{
private OpmlItemCollection _collection;
internal ReadOnlyList(OpmlItemCollection collection) : base(Tag.Default)
{
this._collection = collection;
}
#region Public Properties
public override int Capacity
{
get { return this._collection.Capacity; }
set { throw new NotSupportedException("Read-only collections cannot be modified."); }
}
public override int Count
{
get { return this._collection.Count; }
}
public override bool IsFixedSize
{
get { return true; }
}
public override bool IsReadOnly
{
get { return true; }
}
public override bool IsSynchronized
{
get { return this._collection.IsSynchronized; }
}
public override OpmlItem this[int index]
{
get { return this._collection[index]; }
set { throw new NotSupportedException("Read-only collections cannot be modified."); }
}
public override object SyncRoot
{
get { return this._collection.SyncRoot; }
}
#endregion
#region Public Methods
public override int Add(OpmlItem value)
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override void AddRange(OpmlItemCollection collection)
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override void AddRange(OpmlItem[] array)
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override int BinarySearch(OpmlItem value)
{
return this._collection.BinarySearch(value);
}
public override void Clear()
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override object Clone()
{
return new ReadOnlyList((OpmlItemCollection) this._collection.Clone());
}
public override bool Contains(OpmlItem value)
{
return this._collection.Contains(value);
}
public override void CopyTo(OpmlItem[] array)
{
this._collection.CopyTo(array);
}
public override void CopyTo(OpmlItem[] array, int arrayIndex)
{
this._collection.CopyTo(array, arrayIndex);
}
public override IOpmlItemEnumerator GetEnumerator()
{
return this._collection.GetEnumerator();
}
public override int IndexOf(OpmlItem value)
{
return this._collection.IndexOf(value);
}
public override void Insert(int index, OpmlItem value)
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override void Remove(OpmlItem value)
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override void RemoveAt(int index)
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override void RemoveRange(int index, int count)
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override void Sort()
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
public override OpmlItem[] ToArray()
{
return this._collection.ToArray();
}
public override void TrimToSize()
{
throw new NotSupportedException("Read-only collections cannot be modified.");
}
#endregion
}
#endregion
#region Class SyncList
[Serializable]
private sealed class SyncList : OpmlItemCollection
{
private OpmlItemCollection _collection;
private object _root;
internal SyncList(OpmlItemCollection collection) : base(Tag.Default)
{
this._root = collection.SyncRoot;
this._collection = collection;
}
#region Public Properties
public override int Capacity
{
get
{
lock (this._root)
return this._collection.Capacity;
}
set
{
lock (this._root)
this._collection.Capacity = value;
}
}
public override int Count
{
get
{
lock (this._root)
return this._collection.Count;
}
}
public override bool IsFixedSize
get { return this._collection.IsFixedSize; }
}
public override bool IsReadOnly
{
get { return this._collection.IsReadOnly; }
}
public override bool IsSynchronized
{
get { return true; }
}
public override OpmlItem this[int index]
{
get
{
lock (this._root)
return this._collection[index];
}
set
{
lock (this._root)
this._collection[index] = value;
}
}
public override object SyncRoot
{
get { return this._root; }
}
#endregion
#region Public Methods
public override int Add(OpmlItem value)
{
lock (this._root)
return this._collection.Add(value);
}
public override void AddRange(OpmlItemCollection collection)
{
lock (this._root)
this._collection.AddRange(collection);
}
public override void AddRange(OpmlItem[] array)
{
lock (this._root)
this._collection.AddRange(array);
}
public override int BinarySearch(OpmlItem value)
{
lock (this._root)
return this._collection.BinarySearch(value);
}
public override void Clear()
{
lock (this._root)
this._collection.Clear();
}
public override object Clone()
{
lock (this._root)
return new SyncList((OpmlItemCollection) this._collection.Clone());
}
public override bool Contains(OpmlItem value)
{
lock (this._root)
return this._collection.Contains(value);
}
public override void CopyTo(OpmlItem[] array)
{
lock (this._root)
this._collection.CopyTo(array);
}
public override void CopyTo(OpmlItem[] array, int arrayIndex)
{
lock (this._root)
this._collection.CopyTo(array, arrayIndex);
}
public override IOpmlItemEnumerator GetEnumerator()
{
lock (this._root)
return this._collection.GetEnumerator();
}
public override int IndexOf(OpmlItem value)
{
lock (this._root)
return this._collection.IndexOf(value);
}
public override void Insert(int index, OpmlItem value)
{
lock (this._root)
this._collection.Insert(index, value);
}
public override void Remove(OpmlItem value)
{
lock (this._root)
this._collection.Remove(value);
}
public override void RemoveAt(int index)
{
lock (this._root)
this._collection.RemoveAt(index);
}
public override void RemoveRange(int index, int count)
{
lock (this._root)
this._collection.RemoveRange(index, count);
}
{
lock (this._root)
this._collection.Sort();
}
public override OpmlItem[] ToArray()
{
lock (this._root)
return this._collection.ToArray();
}
public override void TrimToSize()
{
lock (this._root)
this._collection.TrimToSize();
}
#endregion
}
#endregion
}
#endregion
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -