示例#1
0
 public void SaveFile()
 {
     if (instance != null)
     {
         lock (LockObject)
         {
             SerializationController.SerializeFile <RedditSubscriptionsFile>(instance, filepath);
         }
     }
 }
示例#2
0
 public ISlotObjectPersistable Load()
 {
     try
     {
         return((ItemBar)SerializationController.Deserialize(PrefabRepository.PersistItemBarName + ".txt"));
     }
     catch (Exception e)
     {
         return(null);
     }
 }
示例#3
0
        /// <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));
        }
示例#5
0
 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);
     }
 }
示例#6
0
        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);
        }
示例#7
0
 public bool SaveChanges()
 {
     Debug.Log("Save World");
     SerializationController.Serialize(WorldName + "_" + Seed + ".txt", this);
     return(true);
 }
示例#8
0
 public void SaveChanges()
 {
     SerializationController.Serialize(PrefabRepository.PersistItemBarName + ".txt", this);
 }
 private void SaveFile()
 {
     SerializationController.SerializeFile <CustomAudioCommandFile>(Instance, CustomAudioJsonFile);
 }