/// <summary> /// Write a dictionary object to a JSON file in the session folder (in a new FileIOManager thread) /// </summary> /// <param name="dict">Dictionary object to write</param> /// <param name="objectName">Name of the object (is used for file name)</param> void WriteDictToSessionFolder(Dictionary <string, object> dict, string objectName) { string fileName = string.Format("{0}.json", objectName); string filePath = Path.Combine(path, fileName); fileIOManager.ManageInWorker(() => fileIOManager.WriteJson(filePath, dict)); }
/// <summary> /// Write a dictionary object to a JSON file in the session folder (in a new FileIOManager thread) /// </summary> /// <param name="dict">Dictionary object to write</param> /// <param name="objectName">Name of the object (is used for file name)</param> public void WriteDictToSessionFolder(Dictionary <string, object> dict, string objectName) { if (hasInitialised) { string fileName = string.Format("{0}.json", objectName); WriteFileInfo fileInfo = new WriteFileInfo( WriteFileType.Dictionary, this.basePath, experimentName, ppid, folderName, fileName ); fileIOManager.ManageInWorker(() => fileIOManager.WriteJson(dict, fileInfo)); } else { throw new System.InvalidOperationException("Can't write dictionary before session has initalised!"); } }