예제 #1
0
        public static TM_UserData   handle_UserData_ConfigActions(this TM_UserData userData)
        {
            var userConfigFile = userData.Path_UserData.pathCombine("TMConfig.config");

            if (userConfigFile.fileExists())
            {
                var newConfig = userConfigFile.load <TMConfig>();    // to check that the new TMConfig is not corrupted
                if (newConfig.isNull())
                {
                    "[handleUserDataConfigActions] failed to load config file from: {0}".error(userConfigFile);
                }
                else
                {
                    TMConfig.Location = userConfigFile;                         // update the value of TMConfig.config location
                    TMConfig.loadConfig();                                      // reload the TMConfig from the updated location
                    //TMConfig.Current = newConfig;
                    userData.AutoGitCommit = newConfig.Git.AutoCommit_UserData; // in case this changed
                }
            }
            return(userData);
        }
예제 #2
0
 [Admin] public bool          Reload_TMConfig()
 {
     TMConfig.loadConfig();                                  // load default one
     TM_UserData.Current.handle_UserData_ConfigActions();    // load (if available) from current UserData location
     return(true);
 }