BogaNet 1.4.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BogaNet.Extension.DictionaryExtension Class Reference

Extension methods for IDictionary. More...

Static Public Member Functions

static string BNDump< K, V > (this IDictionary< K, V > dict, bool appendNewLine=true, string? prefix="", string? postfix="", string delimiter="; ")
 Dumps a dictionary to a string.
 
static void BNAddRange< K, V > (this IDictionary< K, V > dict, IDictionary< K, V > collection)
 Adds a dictionary to an existing one.
 
static DictionaryXML< K, V > BNToDictionaryXML< K, V > (this IDictionary< K, V > dict)
 Converts a dictionary to a XML serializable dictionary.
 
static List< K > BNKeys< K, V > (this IDictionary< K, V > dict)
 Gets the keys of a Dictionary as List.
 

Detailed Description

Extension methods for IDictionary.

Member Function Documentation

◆ BNAddRange< K, V >()

static void BogaNet.Extension.DictionaryExtension.BNAddRange< K, V > ( this IDictionary< K, V > dict,
IDictionary< K, V > collection )
static

Adds a dictionary to an existing one.

Parameters
dictIDictionary-instance
collectionDictionary to add
Exceptions
ArgumentNullException
Type Constraints
K :notnull 

◆ BNDump< K, V >()

static string BogaNet.Extension.DictionaryExtension.BNDump< K, V > ( this IDictionary< K, V > dict,
bool appendNewLine = true,
string? prefix = "",
string? postfix = "",
string delimiter = "; " )
static

Dumps a dictionary to a string.

Parameters
dictIDictionary-instance to dump
appendNewLineAppend new line, otherwise use the given delimiter (optional, default: true)
prefixPrefix for every element (optional, default: empty)
postfixPostfix for every element (optional, default: empty)
delimiterDelimiter if appendNewLine is false (optional, default: "; ")
Returns
String with lines for all dictionary entries
Exceptions
ArgumentNullException

◆ BNKeys< K, V >()

static List< K > BogaNet.Extension.DictionaryExtension.BNKeys< K, V > ( this IDictionary< K, V > dict)
static

Gets the keys of a Dictionary as List.

Parameters
dictDictionary with the keys
Returns
List of all keys from the dictionary
Exceptions
ArgumentNullException
Type Constraints
K :notnull 

◆ BNToDictionaryXML< K, V >()

static DictionaryXML< K, V > BogaNet.Extension.DictionaryExtension.BNToDictionaryXML< K, V > ( this IDictionary< K, V > dict)
static

Converts a dictionary to a XML serializable dictionary.

Parameters
dictStandard dictionary
Returns
XML serializable dictionary
Exceptions
ArgumentNullException
Type Constraints
K :notnull 

The documentation for this class was generated from the following file: