示例#1
0
        /// <summary>
        ///     执行表达式
        /// </summary>
        /// <param name="expr">表达式</param>
        /// <param name="spec">表示器代号</param>
        /// <returns>执行结果</returns>
        public IQueryResult Execute(string expr, string spec)
        {
            switch (expr)
            {
            case "T":
                return(ListTitles());

            case "?":
                return(ListHelp());

            case "reload":
                return(new NumberAffected(MetaConfigManager.ReloadAll()));

            case "die":
                Environment.Exit(0);
                break;
            }

            return(m_Composer.Execute(expr, GetSerializer(spec)));
        }
示例#2
0
 /// <summary>
 ///     设置配置文件
 /// </summary>
 /// <param name="filename">文件名</param>
 public ConfigManager(string filename)
 {
     m_FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.d", filename);
     Reload(false);
     MetaConfigManager.Register(this);
 }