Synchronized Collection<T> Recommendation



What is the recommended pattern for implementing a synchronized
(thread-safe) class that inherits from Collection<T>? For example, I want
to implement a SyncRoot property [of type
System.Threading.ReaderWriterLock]. I do see where I can override
(protected) the methods InsertItem, RemoveItem, ClearItems, and SetItem.
However, I do not see an override for GetItem.

Kindest regards,
Michael


.



Relevant Pages

  • Re: Synchronized Collection Recommendation
    ... class that inherits from Collection? ... to implement a SyncRoot property [of type ... I do not see an override for GetItem. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: CollectionBase inheritance problem
    ... The BaseCollection.List property is overridable requiring you to override it ... > Public Class ShapesCollection ... > Inherits BaseCollection ... > Private Sub frmDraw_Load(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)
  • inheritance not working properly -- Help please!!
    ... I have two classes in C#, one is the base, the other inherits from the base ... when I type "public override", ... method so I can override it in my inherited class? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Run code for every Page_Load?
    ... Another alternative is to create your own page class that inherits from Page ... Then you can override the ... >> Elton Wang ... >> avoid having to ...
    (microsoft.public.dotnet.framework.aspnet)
  • How to override Control.Focused?
    ... Within a custom-control (inherits system.windows.forms.control), ... contains some 'basic'-controls I want to override the Focused-property, ... because oztherwise it always returns false. ...
    (microsoft.public.dotnet.framework.compactframework)