SortedDictionary.System.Collections.IDictionary.Remove メソッド
アセンブリ: System (system.dll 内)

Private Sub System.Collections.IDictionary.Remove ( _ key As Object _ ) Implements IDictionary.Remove
Dim instance As SortedDictionary(Of TKey, TValue) Dim key As Object CType(instance, IDictionary).Remove(key)
private: virtual void System.Collections.IDictionary.Remove ( Object^ key ) sealed = IDictionary::Remove



SortedDictionary で System.Collections.IDictionary インターフェイスの System.Collections.IDictionary.Remove を使用する方法を次のコード例に示します。
次のコード例は、System.Collections.IDictionary.Add メソッドのトピックで取り上げている例および出力の一部分です。
Imports System Imports System.Collections Imports System.Collections.Generic Public Class Example Public Shared Sub Main() ' Create a new sorted dictionary of strings, with string keys , ' and access it using the IDictionary interface. ' Dim openWith As IDictionary = _ New SortedDictionary(Of String, String) ' Add some elements to the dictionary. There are no ' duplicate keys, but some of the values are duplicates. ' IDictionary.Add throws an exception if incorrect types ' are supplied for key or value. openWith.Add("txt", "notepad.exe") openWith.Add("bmp", "paint.exe") openWith.Add("dib", "paint.exe") openWith.Add("rtf", "wordpad.exe") <br /><span space="preserve">...</span><br /> ' Use the Remove method to remove a key/value pair. No ' exception is thrown if the wrong data type is supplied. Console.WriteLine(vbLf + "Remove(""dib"")") openWith.Remove("dib") If Not openWith.Contains("dib") Then Console.WriteLine("Key ""dib"" is not found.") End If <br /><span space="preserve">...</span><br /> End Sub End Class
using System; using System.Collections; using System.Collections.Generic; public class Example { public static void Main() { // Create a new sorted dictionary of strings, with string keys , // and access it using the IDictionary interface. // IDictionary openWith = new SortedDictionary<string, string>(); // Add some elements to the dictionary. There are no // duplicate keys, but some of the values are duplicates. // IDictionary.Add throws an exception if incorrect types // are supplied for key or value. openWith.Add("txt", "notepad.exe"); openWith.Add("bmp", "paint.exe"); openWith.Add("dib", "paint.exe"); openWith.Add("rtf", "wordpad.exe"); <br /><span space="preserve">...</span><br /> // Use the Remove method to remove a key/value pair. No // exception is thrown if the wrong data type is supplied. Console.WriteLine("\nRemove(\"dib\")"); openWith.Remove("dib"); if (!openWith.Contains("dib")) { Console.WriteLine("Key \"dib\" is not found."); } <br /><span space="preserve">...</span><br /> } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- SortedDictionary.System.Collections.IDictionary.Remove メソッドのページへのリンク