PropertyCollection.System.Collections.IDictionary.Remove メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PropertyCollection.System.Collections.IDictionary.Remove メソッドの意味・解説 

PropertyCollection.System.Collections.IDictionary.Remove メソッド

指定したキー持つ要素を IDictionary オブジェクトから削除します

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

Private Sub System.Collections.IDictionary.Remove
 ( _
    key As Object _
) Implements IDictionary.Remove
Dim instance As PropertyCollection
Dim key As Object

CType(instance, IDictionary).Remove(key)
void IDictionary.Remove (
    Object key
)
private:
virtual void System.Collections.IDictionary.Remove (
    Object^ key
) sealed = IDictionary::Remove

パラメータ

key

削除する要素キー

例外例外
例外種類条件

ArgumentNullException

keynull 参照 (Visual Basic では Nothing) です。

NotSupportedException

IDictionary読み取り専用です。

または

IDictionary固定サイズです。

使用例使用例

Remove メソッド実装する方法の例を次に示します。このコード例は、IDictionary クラストピック取り上げているコード例一部です。

Public Sub Remove(ByVal
 key As Object) Implements
 IDictionary.Remove
    If key = Nothing Then
        Throw New ArgumentNullException("key")
    End If
    ' Try to find the key in the DictionaryEntry array
    Dim index As Integer
    If TryGetIndexOfKey(key, index) Then

        ' If the key is found, slide all the items up.
        Array.Copy(items, index + 1, items, index, (ItemsInUse - index) - 1)
        ItemsInUse = ItemsInUse - 1
    Else

        ' If the key is not in the dictionary, just return. 
    End If
End Sub
public void Remove(object key)
{
    if (key == null) throw new
 ArgumentNullException("key");
    // Try to find the key in the DictionaryEntry array
    Int32 index;
    if (TryGetIndexOfKey(key, out index))
    {
        // If the key is found, slide all the items up.
        Array.Copy(items, index + 1, items, index, ItemsInUse - index - 1);
        ItemsInUse--;
    } 
    else
    {
        // If the key is not in the dictionary, just return. 
    }
}
public:
    virtual void Remove(Object^ key)
    {
        if (key == nullptr)
        {
            throw gcnew ArgumentNullException("key");
        }
        // Try to find the key in the DictionaryEntry array
        int index;
        if (TryGetIndexOfKey(key, &index))
        {
            // If the key is found, slide all the items down.
            Array::Copy(items, index + 1, items, index, itemsInUse -
                index - 1);
            itemsInUse--;
        }
        else
        {
            // If the key is not in the dictionary, just return.
            return;
        }
    }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からPropertyCollection.System.Collections.IDictionary.Remove メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からPropertyCollection.System.Collections.IDictionary.Remove メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からPropertyCollection.System.Collections.IDictionary.Remove メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

PropertyCollection.System.Collections.IDictionary.Remove メソッドのお隣キーワード
検索ランキング

   

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



PropertyCollection.System.Collections.IDictionary.Remove メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS