Class DirectoryUtil
Inheritance
System.Object
DirectoryUtil
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: PLATEAU.Util
Assembly: cs.temp.dll.dll
Syntax
public static class DirectoryUtil
Methods
GetValueOrCreate<TKey, TValue>(IDictionary<TKey, TValue>, TKey)
TryGetValueして存在しない場合にnew TValue()で生成して追加したうえで返す
Declaration
public static TValue GetValueOrCreate<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key)
where TValue : new()
Parameters
Type | Name | Description |
---|---|---|
IDictionary<TKey, TValue> | self | |
TKey | key |
Returns
Type | Description |
---|---|
TValue |
Type Parameters
Name | Description |
---|---|
TKey | |
TValue |
GetValueOrCreate<TKey, TValue>(IDictionary<TKey, TValue>, TKey, Func<TKey, TValue>)
TryGetValueして存在しない場合にfactoryで新規オブジェクトを生成して追加したうえで返す
Declaration
public static TValue GetValueOrCreate<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key, Func<TKey, TValue> factory)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<TKey, TValue> | self | |
TKey | key | |
Func<TKey, TValue> | factory |
Returns
Type | Description |
---|---|
TValue |
Type Parameters
Name | Description |
---|---|
TKey | |
TValue |