aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/DictionaryExtensions.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-12-02 00:44:45 -0800
committerRob Mensching <rob@firegiant.com>2017-12-02 00:44:45 -0800
commit53e877183abe0dbbb623c39380101bc369e9f265 (patch)
tree2b1a35e142d76013ba28d0a50e894ff477ee247a /src/WixToolset.Data/DictionaryExtensions.cs
parent414bf166e07703056ad186fa8ec23a4119dd9993 (diff)
downloadwix-53e877183abe0dbbb623c39380101bc369e9f265.tar.gz
wix-53e877183abe0dbbb623c39380101bc369e9f265.tar.bz2
wix-53e877183abe0dbbb623c39380101bc369e9f265.zip
Support tuples from extensions and make SourcePath a path instead of string
Diffstat (limited to 'src/WixToolset.Data/DictionaryExtensions.cs')
-rw-r--r--src/WixToolset.Data/DictionaryExtensions.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/WixToolset.Data/DictionaryExtensions.cs b/src/WixToolset.Data/DictionaryExtensions.cs
new file mode 100644
index 00000000..cb6647ff
--- /dev/null
+++ b/src/WixToolset.Data/DictionaryExtensions.cs
@@ -0,0 +1,14 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Data
4{
5 using System.Collections.Generic;
6
7 internal static class DictionaryExtensions
8 {
9 public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dictionary, K key, V defaultValue = default(V))
10 {
11 return dictionary.TryGetValue(key, out var value) ? value : defaultValue;
12 }
13 }
14}