ES2.LoadDictionary

public static Dictionary<TKey,TValue> LoadDictionary<TKey,TValue>(string path, ES2Settings settings=null)

Parameters

[table th=”0″]TKey, TValue,”The type of the key and value of the Dictionary. Must be on the Supported Types list.

path,”The path where our data is stored. For more information, see Paths.”

settings,”Optional. A user-created ES2Settings object containing options not specified in path.”[/table]

Returns

[table th=”0″]Dictionary<TKey TValue>,”Our loaded Dictionary.”[/table]

Description

Loads a Dictionary containing data pairs of type TKey,TValue from the specified path.

C#

// Create a Dictionary of string/int pairs and save it.
Dictionary myDictionary<string, int> = new Dictionary<string, int>();
myDictionary["A"] = 1;
myDictionary["B"] = 2;
  
ES2.Save(myDictionary, "myFile.txt?tag=myDictionary");
  
// Load the Dictionary and re-assign it to our variable.
myDictionary = ES2.LoadDictionary<string, int>("myFile.txt?tag=myDictionary");

JS

// Create a Dictionary of string/int pairs and save it.
var myDictionary = new Dictionary.<String, int>();
myDictionary["A"] = 1;
myDictionary["B"] = 2;
  
ES2.Save(myDictionary, "myFile.txt?tag=myDictionary");
  
// Load the Dictionary and re-assign it to our variable.
myDictionary = ES2.LoadDictionary.<String, int>("myFile.txt?tag=myDictionary");