-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
148 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# DictionaryExtensionMethods | ||
|
||
Namespace: MountainGoap | ||
|
||
Extension method to copy a dictionary of strings and objects. | ||
|
||
```csharp | ||
public static class DictionaryExtensionMethods | ||
``` | ||
|
||
Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [DictionaryExtensionMethods](./mountaingoap.dictionaryextensionmethods.md) | ||
## Methods | ||
|
||
### **Add(ConcurrentDictionary<String, Object>, String, Object)** | ||
|
||
Add functionality for ConcurrentDictionary. | ||
|
||
```csharp | ||
public static void Add(ConcurrentDictionary<string, object> dictionary, string key, object value) | ||
``` | ||
|
||
#### Parameters | ||
|
||
`dictionary` ConcurrentDictionary<String, Object><br> | ||
Dictionary to which to add an item. | ||
|
||
`key` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br> | ||
Key to add. | ||
|
||
`value` [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)<br> | ||
Value to add. | ||
|
||
### **Copy(Dictionary<String, Object>)** | ||
|
||
Copies the dictionary to a shallow clone. | ||
|
||
```csharp | ||
internal static Dictionary<string, object> Copy(Dictionary<string, object> dictionary) | ||
``` | ||
|
||
#### Parameters | ||
|
||
`dictionary` [Dictionary<String, Object>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
Dictionary to be copied. | ||
|
||
#### Returns | ||
|
||
[Dictionary<String, Object>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
A shallow copy of the dictionary. | ||
|
||
### **Copy(ConcurrentDictionary<String, Object>)** | ||
|
||
Copies the concurrent dictionary to a shallow clone. | ||
|
||
```csharp | ||
internal static ConcurrentDictionary<string, object> Copy(ConcurrentDictionary<string, object> dictionary) | ||
``` | ||
|
||
#### Parameters | ||
|
||
`dictionary` ConcurrentDictionary<String, Object><br> | ||
Dictionary to be copied. | ||
|
||
#### Returns | ||
|
||
ConcurrentDictionary<String, Object><br> | ||
A shallow copy of the dictionary. | ||
|
||
### **Copy(Dictionary<String, ComparisonValuePair>)** | ||
|
||
Copies the dictionary to a shallow clone. | ||
|
||
```csharp | ||
internal static Dictionary<string, ComparisonValuePair> Copy(Dictionary<string, ComparisonValuePair> dictionary) | ||
``` | ||
|
||
#### Parameters | ||
|
||
`dictionary` [Dictionary<String, ComparisonValuePair>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
Dictionary to be copied. | ||
|
||
#### Returns | ||
|
||
[Dictionary<String, ComparisonValuePair>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
A shallow copy of the dictionary. | ||
|
||
### **Copy(Dictionary<String, String>)** | ||
|
||
Copies the dictionary to a shallow clone. | ||
|
||
```csharp | ||
internal static Dictionary<string, string> Copy(Dictionary<string, string> dictionary) | ||
``` | ||
|
||
#### Parameters | ||
|
||
`dictionary` [Dictionary<String, String>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
Dictionary to be copied. | ||
|
||
#### Returns | ||
|
||
[Dictionary<String, String>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
A shallow copy of the dictionary. | ||
|
||
### **CopyNonNullable(Dictionary<String, Object>)** | ||
|
||
Copies the dictionary to a shallow clone. | ||
|
||
```csharp | ||
internal static Dictionary<string, object> CopyNonNullable(Dictionary<string, object> dictionary) | ||
``` | ||
|
||
#### Parameters | ||
|
||
`dictionary` [Dictionary<String, Object>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
Dictionary to be copied. | ||
|
||
#### Returns | ||
|
||
[Dictionary<String, Object>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2)<br> | ||
A shallow copy of the dictionary. |