StringCollection.IsSynchronized プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > StringCollection.IsSynchronized プロパティの意味・解説 

StringCollection.IsSynchronized プロパティ

StringCollection へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。

名前空間: System.Collections.Specialized
アセンブリ: System (system.dll 内)
構文構文

Dim instance As StringCollection
Dim value As Boolean

value = instance.IsSynchronized
public bool IsSynchronized { get;
 }
public:
virtual property bool IsSynchronized {
    bool get () sealed;
}
/** @property */
public final boolean get_IsSynchronized ()

プロパティ値
このプロパティは常に false を返します。

解説解説

System.Collections.ICollection インターフェイスが IsSynchronized プロパティを必要とするため、StringCollection はこのプロパティを実装します。

コレクションの列挙処理は、本質的にはスレッド セーフな処理ではありません。コレクションが同期されている場合でも、他のスレッドがそのコレクションを変更する可能性はあり、そのような状況が発生すると列挙子は例外をスローします。列挙処理を確実にスレッド セーフに行うには、列挙中にコレクションをロックするか、他のスレッドによって行われた変更によってスローされる例外をキャッチします。

列挙処理中に SyncRoot を使用してコレクションをロックする方法を次のコード例に示します。

StringCollection myCollection = new StringCollection();
  lock(myCollection.SyncRoot) {
  foreach (Object item in myCollection) {
  // Insert your code here.
  }
 }
Dim myCollection As New
 StringCollection()
 Dim item As Object
 SyncLock myCollection.SyncRoot
  For Each item In myCollection
  ' Insert your code here.
  Next item
 End SyncLock

このプロパティ値を取得することは、O(1) 操作になります。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
StringCollection クラス
StringCollection メンバ
System.Collections.Specialized 名前空間
SyncRoot



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「StringCollection.IsSynchronized プロパティ」の関連用語

StringCollection.IsSynchronized プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



StringCollection.IsSynchronized プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS