Example #1
0
        /// <summary>
        /// 把某个自定义的聚合块保存到硬盘上。
        /// </summary>
        /// <param name="blocksName"></param>
        /// <param name="blocks"></param>
        public void Save(string blocksName, AggtBlocks blocks)
        {
            var path = XmlConfigFileSystem.GetCompositeBlocksFilePath(blocksName);
            var xml  = blocks.ToXmlString();

            File.WriteAllText(path, xml);
        }
Example #2
0
        /// <summary>
        /// 创建某个自定义的聚合块
        /// </summary>
        /// <param name="blocksName"></param>
        /// <returns></returns>
        public AggtBlocks GetBlocks(string blocksName)
        {
            var path = XmlConfigFileSystem.GetCompositeBlocksFilePath(blocksName);

            if (File.Exists(path))
            {
                var xml = File.ReadAllText(path);

                var blocks = AggtBlocks.FromXml(xml);
                return(blocks);
            }

            return(null);
        }