You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Merges a key/value pair into the dictionary. If the key already exists, the existing value and new value are combined using the specified function; otherwise, the key/value pair is added directly.
93
94
/// </remarks>
95
+
/// <typeparam name="TKey">键的类型 / The type of the keys in the dictionary.</typeparam>
96
+
/// <typeparam name="TValue">值的类型 / The type of the values in the dictionary.</typeparam>
97
+
/// <param name="self">要合并的字典,不能为 null / The dictionary to merge into, cannot be null.</param>
98
+
/// <param name="key">要添加或合并的键 / The key to add or merge.</param>
99
+
/// <param name="v">要添加或合并的值 / The value to add or merge.</param>
100
+
/// <param name="func">用于合并值的函数,接收两个参数:现有值和新值,返回合并后的结果,不能为 null / The function to use to merge values if the key exists, cannot be null.</param>
/// Gets the value associated with the specified key. If the key does not exist, the value is created using the specified function and added to the dictionary.
121
+
/// </remarks>
122
+
/// <typeparam name="TKey">键的类型 / The type of the keys in the dictionary.</typeparam>
123
+
/// <typeparam name="TValue">值的类型 / The type of the values in the dictionary.</typeparam>
124
+
/// <param name="self">要操作的字典,不能为 null / The dictionary to operate on, cannot be null.</param>
125
+
/// <param name="key">要获取值的键 / The key whose value to get.</param>
126
+
/// <param name="valueGetter">用于获取值的函数,接收键作为参数并返回对应的值,不能为 null / The function to use to generate a value if the key is not found, cannot be null.</param>
127
+
/// <returns>指定键的值。如果键不存在,则返回新创建的值 / The value associated with the specified key. If the key does not exist, returns the newly created value.</returns>
128
+
/// <exception cref="ArgumentNullException">当 <paramref name="self"/>、<paramref name="key"/>(如果是引用类型)或 <paramref name="valueGetter"/> 为 null 时抛出 / Thrown when <paramref name="self"/>, <paramref name="key"/> (if reference type), or <paramref name="valueGetter"/> is null.</exception>
/// Gets the value associated with the specified key. If the key does not exist, a new value is created using the parameterless constructor and added to the dictionary.
149
+
/// </remarks>
150
+
/// <typeparam name="TKey">键的类型 / The type of the keys in the dictionary.</typeparam>
151
+
/// <typeparam name="TValue">值的类型,必须包含无参构造函数 / The type of the values in the dictionary, must have a parameterless constructor.</typeparam>
152
+
/// <param name="self">要操作的字典,不能为 null / The dictionary to operate on, cannot be null.</param>
153
+
/// <param name="key">要获取值的键 / The key whose value to get.</param>
154
+
/// <returns>指定键的值。如果键不存在,则返回新创建的值 / The value associated with the specified key. If the key does not exist, returns the newly created value.</returns>
155
+
/// <exception cref="ArgumentNullException">当 <paramref name="self"/> 或 <paramref name="key"/> 为 null 时抛出 / Thrown when <paramref name="self"/> or <paramref name="key"/> is null.</exception>
/// Removes all key/value pairs from the dictionary that match the specified condition.
166
+
/// This method iterates through all key/value pairs and removes those where the predicate returns true.
167
+
/// To avoid modifying the collection during iteration, keys to remove are collected first, then removed.
160
168
/// </remarks>
169
+
/// <typeparam name="TKey">键的类型 / The type of the keys in the dictionary.</typeparam>
170
+
/// <typeparam name="TValue">值的类型 / The type of the values in the dictionary.</typeparam>
171
+
/// <param name="self">要操作的字典,不能为 null / The dictionary to operate on, cannot be null.</param>
172
+
/// <param name="predict">判断是否移除键值对的条件,接收键和值作为参数,返回true表示需要移除,不能为 null / The predicate function to determine which items to remove, cannot be null.</param>
173
+
/// <returns>移除的键值对数量 / The number of items removed.</returns>
174
+
/// <exception cref="ArgumentNullException">当 <paramref name="self"/> 或 <paramref name="predict"/> 为 null 时抛出 / Thrown when <paramref name="self"/> or <paramref name="predict"/> is null.</exception>
/// Removes all elements from the list that match the specified condition.
278
+
/// This method uses <see cref="List{T}.RemoveAll(Predicate{T})"/> to remove all matching elements at once.
262
279
/// </remarks>
280
+
/// <typeparam name="T">列表元素的类型 / The type of elements in the list.</typeparam>
281
+
/// <param name="list">要操作的列表,不能为 null / The list to operate on, cannot be null.</param>
282
+
/// <param name="condition">用于判断元素是否满足移除条件的委托,返回true表示需要移除,不能为 null / The predicate function to determine which items to remove, cannot be null.</param>
283
+
/// <exception cref="ArgumentNullException">当 <paramref name="list"/> 或 <paramref name="condition"/> 为 null 时抛出 / Thrown when <paramref name="list"/> or <paramref name="condition"/> is null.</exception>
0 commit comments