예제 #1
0
        /// <summary>
        ///     Retrieves an instance managing the passed settings file
        /// </summary>
        /// <remarks>
        ///     <code>
        /// var manager = Get("Settings");
        /// </code>
        ///     Will return a manager dealing with Settings\Settings.json
        /// </remarks>
        /// <param name="parParent">The name of the settings file</param>
        /// <returns>OptionManager instance</returns>
        public static OptionManager Get(string parParent)
        {
            var tmpManager = _Managers.FirstOrDefault(i => i.Name == parParent);

            if (tmpManager != null)
            {
                return(tmpManager);
            }
            tmpManager = new OptionManager(parParent);
            _Managers.Add(tmpManager);
            return(tmpManager);
        }
예제 #2
0
 internal void Save()
 {
     OptionManager.Get("Settings").SaveToJson(this);
 }
예제 #3
0
 internal void Load()
 {
     Values = OptionManager.Get("Settings").LoadFromJson <Options>();
 }