SynchronizedReadOnlyCollection<T> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class.
Overloads
SynchronizedReadOnlyCollection<T>() |
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class. |
SynchronizedReadOnlyCollection<T>(Object) |
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class with the object used to synchronize access to the thread-safe, read-only collection. |
SynchronizedReadOnlyCollection<T>(Object, IEnumerable<T>) |
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified enumerable list of elements and with the object used to synchronize access to the thread-safe, read-only collection. |
SynchronizedReadOnlyCollection<T>(Object, T[]) |
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified array of elements and with the object used to synchronize access to the thread-safe, read-only collection. |
SynchronizedReadOnlyCollection<T>()
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class.
public:
SynchronizedReadOnlyCollection();
public SynchronizedReadOnlyCollection ();
Public Sub New ()
Applies to
SynchronizedReadOnlyCollection<T>(Object)
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class with the object used to synchronize access to the thread-safe, read-only collection.
public:
SynchronizedReadOnlyCollection(System::Object ^ syncRoot);
public SynchronizedReadOnlyCollection (object syncRoot);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (syncRoot As Object)
Parameters
- syncRoot
- Object
The object used to synchronize access to the thread-safe, read-only collection.
Exceptions
syncRoot
is null
.
Remarks
If multiple instances of the SynchronizedReadOnlyCollection<T> are created using the same syncRoot
, then access is protected across all instances.
Applies to
SynchronizedReadOnlyCollection<T>(Object, IEnumerable<T>)
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified enumerable list of elements and with the object used to synchronize access to the thread-safe, read-only collection.
public:
SynchronizedReadOnlyCollection(System::Object ^ syncRoot, System::Collections::Generic::IEnumerable<T> ^ list);
public SynchronizedReadOnlyCollection (object syncRoot, System.Collections.Generic.IEnumerable<T> list);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj * seq<'T> -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (syncRoot As Object, list As IEnumerable(Of T))
Parameters
- syncRoot
- Object
The object used to synchronize access to the thread-safe, read-only collection.
- list
- IEnumerable<T>
The IEnumerable<T> collection of elements used to initialize the thread-safe, read-only collection.
Exceptions
syncRoot
or list
is null
.
Applies to
SynchronizedReadOnlyCollection<T>(Object, T[])
Initializes a new instance of the SynchronizedReadOnlyCollection<T> class from a specified array of elements and with the object used to synchronize access to the thread-safe, read-only collection.
public:
SynchronizedReadOnlyCollection(System::Object ^ syncRoot, ... cli::array <T> ^ list);
public SynchronizedReadOnlyCollection (object syncRoot, params T[] list);
new System.Collections.Generic.SynchronizedReadOnlyCollection<'T> : obj * 'T[] -> System.Collections.Generic.SynchronizedReadOnlyCollection<'T>
Public Sub New (syncRoot As Object, ParamArray list As T())
Parameters
- syncRoot
- Object
The object used to synchronize access to the thread-safe, read-only collection.
- list
- T[]
The Array of type T
elements used to initialize the thread-safe, read-only collection.
Exceptions
syncRoot
or list
is null
.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應