예제 #1
0
 /// <summary>
 /// 从 <see cref="ListBase{T}"/> 中移除特定对象的第一个匹配项。
 /// </summary>
 /// <param name="value">要从 <see cref="ListBase{T}"/> 中移除的对象。</param>
 void IList.Remove(object value)
 {
     if (CollectionHelper.IsCompatible <T>(value))
     {
         this.Remove((T)value);
     }
 }
예제 #2
0
 /// <summary>
 /// 确定 <see cref="ReadOnlyList{T}"/> 中指定对象的索引。
 /// </summary>
 /// <param name="value">要在 <see cref="ReadOnlyList{T}"/> 中定位的对象。</param>
 /// <returns>如果在 <see cref="ReadOnlyList{T}"/> 中找到 <paramref name="value"/>,
 /// 则为该对象的索引;否则为 <c>-1</c>。</returns>
 int IList.IndexOf(object value)
 {
     if (CollectionHelper.IsCompatible <T>(value))
     {
         return(IndexOf((T)value));
     }
     return(-1);
 }
예제 #3
0
 /// <summary>
 /// 确定 <see cref="ReadOnlyList{T}"/> 是否包含指定对象。
 /// </summary>
 /// <param name="value">要在 <see cref="ReadOnlyList{T}"/> 中定位的对象。</param>
 /// <returns>如果在 <see cref="ReadOnlyList{T}"/> 中找到 <paramref name="value"/>,
 /// 则为 <c>true</c>;否则为 <c>false</c>。</returns>
 bool IList.Contains(object value)
 {
     return(CollectionHelper.IsCompatible <T>(value) && Contains((T)value));
 }