Fantasy
搜索结果

    显示/隐藏目录

    OneToManyList<TKey, TValue> 类

    一对多关系的列表字典。

    继承
    object
    Dictionary<TKey, List<TValue>>
    OneToManyList<TKey, TValue>
    OneToManyListPool<TKey, TValue>
    实现
    IDictionary<TKey, List<TValue>>
    ICollection<KeyValuePair<TKey, List<TValue>>>
    IReadOnlyDictionary<TKey, List<TValue>>
    IReadOnlyCollection<KeyValuePair<TKey, List<TValue>>>
    IEnumerable<KeyValuePair<TKey, List<TValue>>>
    IDictionary
    ICollection
    IEnumerable
    IDeserializationCallback
    ISerializable
    继承成员
    Dictionary<TKey, List<TValue>>.Add(TKey, List<TValue>)
    Dictionary<TKey, List<TValue>>.Clear()
    Dictionary<TKey, List<TValue>>.ContainsKey(TKey)
    Dictionary<TKey, List<TValue>>.ContainsValue(List<TValue>)
    Dictionary<TKey, List<TValue>>.EnsureCapacity(int)
    Dictionary<TKey, List<TValue>>.GetEnumerator()
    Dictionary<TKey, List<TValue>>.GetObjectData(SerializationInfo, StreamingContext)
    Dictionary<TKey, List<TValue>>.OnDeserialization(object)
    Dictionary<TKey, List<TValue>>.Remove(TKey)
    Dictionary<TKey, List<TValue>>.Remove(TKey, out List<TValue>)
    Dictionary<TKey, List<TValue>>.TrimExcess()
    Dictionary<TKey, List<TValue>>.TrimExcess(int)
    Dictionary<TKey, List<TValue>>.TryAdd(TKey, List<TValue>)
    Dictionary<TKey, List<TValue>>.TryGetValue(TKey, out List<TValue>)
    Dictionary<TKey, List<TValue>>.Comparer
    Dictionary<TKey, List<TValue>>.Count
    Dictionary<TKey, List<TValue>>.this[TKey]
    Dictionary<TKey, List<TValue>>.Keys
    Dictionary<TKey, List<TValue>>.Values
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    命名空间: Fantasy.DataStructure.Collection
    程序集: Fantasy.Net.dll
    语法
    public class OneToManyList<TKey, TValue> : Dictionary<TKey, List<TValue>>, IDictionary<TKey, List<TValue>>, ICollection<KeyValuePair<TKey, List<TValue>>>, IReadOnlyDictionary<TKey, List<TValue>>, IReadOnlyCollection<KeyValuePair<TKey, List<TValue>>>, IEnumerable<KeyValuePair<TKey, List<TValue>>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable where TKey : notnull
    类型参数
    名称 描述
    TKey

    键的类型。

    TValue

    值的类型。

    构造函数

    | 编辑本文 查看源代码

    OneToManyList()

    初始化一个新的 OneToManyList<TKey, TValue> 实例。

    声明
    public OneToManyList()
    | 编辑本文 查看源代码

    OneToManyList(int)

    设置最大缓存数量

    声明
    public OneToManyList(int recyclingLimit)
    参数
    类型 名称 描述
    int recyclingLimit

    1:防止数据量过大、所以超过recyclingLimit的数据还是走GC. 2:设置成0不控制数量,全部缓存

    方法

    | 编辑本文 查看源代码

    Add(TKey, TValue)

    向列表中添加指定键和值。

    声明
    public void Add(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要添加值的键。

    TValue value

    要添加的值。

    | 编辑本文 查看源代码

    Clear()

    清除字典中的所有键值对,并回收相关的值集合。

    声明
    public void Clear()
    | 编辑本文 查看源代码

    Contains(TKey, TValue)

    判断给定的键和值是否存在于列表中。

    声明
    public bool Contains(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要搜索的键。

    TValue value

    要搜索的值。

    返回
    类型 描述
    bool

    如果存在则为 true,否则为 false。

    | 编辑本文 查看源代码

    First(TKey)

    获取指定键对应的列表中的第一个值。

    声明
    public TValue First(TKey key)
    参数
    类型 名称 描述
    TKey key

    要获取值的键。

    返回
    类型 描述
    TValue

    键对应的列表中的第一个值。

    | 编辑本文 查看源代码

    GetValues(TKey)

    获取指定键关联的所有值的列表。

    声明
    public List<TValue> GetValues(TKey key)
    参数
    类型 名称 描述
    TKey key

    要获取值的键。

    返回
    类型 描述
    List<TValue>

    键关联的所有值的列表。

    | 编辑本文 查看源代码

    RemoveByKey(TKey)

    从列表中移除指定键及其关联的所有值。

    声明
    public bool RemoveByKey(TKey key)
    参数
    类型 名称 描述
    TKey key

    要移除的键。

    返回
    类型 描述
    bool

    如果成功移除则为 true,否则为 false。

    | 编辑本文 查看源代码

    RemoveValue(TKey, TValue)

    从列表中移除指定键和值。

    声明
    public bool RemoveValue(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要移除值的键。

    TValue value

    要移除的值。

    返回
    类型 描述
    bool

    如果成功移除则为 true,否则为 false。

    实现

    IDictionary<TKey, TValue>
    ICollection<T>
    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IDictionary
    ICollection
    IEnumerable
    IDeserializationCallback
    ISerializable

    扩展方法

    JsonHelper.ToJson<T>(T)
    DictionaryExtensions.TryRemove<T, TV>(IDictionary<T, TV>, T, out TV)
    • 编辑本文
    • 查看源代码
    本文内容
    Back to top Generated by DocFX