コード例 #1
0
        public AjaxConfiguration()
        {
            using (var stream = typeof(AjaxConfiguration).Assembly.GetManifestResourceStream("X3Platform.Ajax.defaults.config.yaml"))
            {
                using (var reader = new StreamReader(stream))
                {
                    // 加载内置配置信息
                    var yaml = new YamlStream();

                    yaml.Load(reader);

                    // 设置配置信息根节点
                    var root = (YamlMappingNode)yaml.Documents[0].RootNode;

                    // 加载 Keys 键值配置信息
                    YamlConfiguratonOperator.SetKeyValues(this.Keys, (YamlMappingNode)root.Children[new YamlScalarNode("keys")]);

                    // 加载 SpecialWords 键值配置信息
                    YamlConfiguratonOperator.SetKeyValues(this.SpecialWords, (YamlMappingNode)root.Children[new YamlScalarNode("specialWords")]);

                    this.Initialized = true;
                }
            }

            this.Initialized = true;
        }
コード例 #2
0
        public WebConfiguration()
        {
            using (var stream = typeof(WebConfiguration).Assembly.GetManifestResourceStream("X3Platform.Web.defaults.config.yaml"))
            {
                using (var reader = new StreamReader(stream))
                {
                    // 加载内置配置信息
                    var yaml = new YamlStream();

                    yaml.Load(reader);

                    // 设置配置信息根节点
                    var root = (YamlMappingNode)yaml.Documents[0].RootNode;

                    // 加载 Keys 键值配置信息
                    YamlConfiguratonOperator.SetKeyValues(this.Keys, (YamlMappingNode)root.Children[new YamlScalarNode("keys")]);

                    // 加载 Navigation 键值配置信息
                    YamlConfiguratonOperator.SetKeyValues(this.Navigation, (YamlMappingNode)root.Children[new YamlScalarNode("navigation")]);

                    // 加载 Menu 键值配置信息
                    YamlConfiguratonOperator.SetKeyValues(this.Menu, (YamlMappingNode)root.Children[new YamlScalarNode("menu")]);

                    // 加载 Customize 键值配置信息
                    YamlConfiguratonOperator.SetKeyValues(this.Customize, (YamlMappingNode)root.Children[new YamlScalarNode("customize")]);

                    this.Initialized = true;
                }
            }

            this.Initialized = true;
        }
コード例 #3
0
        /// <summary></summary>
        public SecurityConfiguration()
        {
            var root = YamlConfiguratonOperator.GetRootNodeByResourceStream <YamlMappingNode>(
                this.GetType().Assembly,
                "X3Platform.Security.defaults.config.yaml");

            // 加载 Keys 键值配置信息
            YamlConfiguratonOperator.SetKeyValues(this.Keys, (YamlMappingNode)root.Children[new YamlScalarNode("keys")]);

            this.Initialized = true;
        }
        /// <summary></summary>
        public DigitalNumberConfiguration()
        {
            // 根据内置 YAML 资源配置文件初始化对象信息

            var root = YamlConfiguratonOperator.GetRootNodeByResourceStream <YamlMappingNode>(
                this.GetType().Assembly,
                "X3Platform.DigitalNumber.defaults.config.yaml");

            // 加载 Keys 键值配置信息
            YamlConfiguratonOperator.SetKeyValues(this.Keys, (YamlMappingNode)root.Children[new YamlScalarNode("keys")]);

            this.Initialized = true;
        }