OSDP.Net
5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
Pollyfill.cs
1
using
System;
2
using
System.Collections.Generic;
3
4
namespace
OSDP.Net.Utilities
;
5
9
public
static
class
Pollyfill
10
{
21
public
static
bool
TryAdd<TKey, TValue>
(
this
IDictionary<TKey, TValue> dictionary, TKey key, TValue value)
22
{
23
if
(dictionary ==
null
)
24
{
25
throw
new
ArgumentNullException(nameof(dictionary));
26
}
27
28
if
(!dictionary.ContainsKey(key))
29
{
30
dictionary.Add(key, value);
31
return
true
;
32
}
33
34
return
false
;
35
}
36
}
OSDP.Net.Utilities.Pollyfill
Provide backward compability to .NET standard 2.0.
Definition
Pollyfill.cs:10
OSDP.Net.Utilities.Pollyfill.TryAdd< TKey, TValue >
static bool TryAdd< TKey, TValue >(this IDictionary< TKey, TValue > dictionary, TKey key, TValue value)
Attempts to add the specified key and value to the dictionary.
Definition
Pollyfill.cs:21
OSDP.Net.Utilities
Definition
BinaryExtensions.cs:4
OSDP.Net
Utilities
Pollyfill.cs
OSDP.Net on z-bitco.com
Generated by
1.15.0