public void SaveFile() { if (instance != null) { lock (LockObject) { SerializationController.SerializeFile <RedditSubscriptionsFile>(instance, filepath); } } }
public ISlotObjectPersistable Load() { try { return((ItemBar)SerializationController.Deserialize(PrefabRepository.PersistItemBarName + ".txt")); } catch (Exception e) { return(null); } }
/// <summary> /// Loads the configuration from file. /// </summary> /// <returns>Returns the <code>CustomAudioCommandFile</code> object loaded from the json file</returns> /// <exception cref="InvalidConfigException"> /// Could not read config file: " + ioex.Message /// or /// Config json was incorrectly formatted: " + jex.Message /// </exception> private static RedditSubscriptionsFile LoadConfigFromFile() { if (!File.Exists(filepath)) { // create the file instance = new RedditSubscriptionsFile(); return(instance); } return(SerializationController.DeserializeFile <RedditSubscriptionsFile>(filepath)); }
/// <summary> /// Loads the configuration from file. /// </summary> /// <param name="filePath">The file path.</param> /// <returns>Returns the <code>CustomAudioCommandFile</code> object loaded from the json file</returns> /// <exception cref="InvalidConfigException"> /// Could not read config file: " + ioex.Message /// or /// Config json was incorrectly formatted: " + jex.Message /// </exception> private static CustomAudioCommandFile LoadConfigFromFile(string filePath) { if (!File.Exists(filePath)) { // create the file instance = new CustomAudioCommandFile(); return(instance); } return(SerializationController.DeserializeFile <CustomAudioCommandFile>(filePath)); }
public static World LoadMap(string map, int seed) { try { Debug.Log("Load World"); World world = (World)SerializationController.Deserialize(map + "_" + seed + ".txt"); return(world); } catch (Exception ex) { return(null); } }
private static ConfigFile LoadConfigFromFile(string filePath) { if (!File.Exists(filePath)) { throw new InvalidConfigException("Config file is missing"); } ConfigFile rVal = SerializationController.DeserializeFile <ConfigFile>(ConfigFilePath); return(rVal); }
public bool SaveChanges() { Debug.Log("Save World"); SerializationController.Serialize(WorldName + "_" + Seed + ".txt", this); return(true); }
public void SaveChanges() { SerializationController.Serialize(PrefabRepository.PersistItemBarName + ".txt", this); }
private void SaveFile() { SerializationController.SerializeFile <CustomAudioCommandFile>(Instance, CustomAudioJsonFile); }