示例#1
0
        public static void ReloadData()
        {
            try
            {
                if (null != _commands)
                {
                    _commands.Clear();
                }

                _commands = Persistence.LoadCommands();
            }
            catch (Exception e)
            {
                throw new Exception(Constants.ERR_COMMANDS_FILE, e);
            }
        }
示例#2
0
        private void LoadCommands()
        {
            try {
                _commandsFile = AppSettingsUtil.AppSettingsString("commandsFile", true, string.Empty);

                if (Persistence.FileExists(_commandsFile))
                {
                    _commands = Persistence.LoadCommands(_commandsFile);
                }
                else
                {
                    _commands = new List <CommandDTO>();
                    SaveCommands();
                }
            }
            catch (Exception e) {
                throw new Exception("Failed to load commands.json file", e);
            }
        }