コード例 #1
0
        private void Write()
        {
            ConfigSerializer serializer = new ConfigSerializer();

            ConfigManager.Instance.SetSerializer(serializer);
            ConfigManager.Instance.ReloadConfigReaderModule(new XmlConfigReaderModule(PathManager.Instance.ExternalXmlConfigFolder, readXmlThread));

            using (BinWriter o = new BinWriter(PlatformManager.Instance.OpenWrite(PathManager.Instance.ExternalBinaryConfig), Encoding.UTF8))
            {
                ConfigManager.Instance.LoadAllConfig();
                if (serializer.Validate())
                {
                    serializer.WriteToBinary(o);
                }
            }
            PlatformManager.Instance.ClearDirectory(PathManager.Instance.ExternalXmlExampleFolder);
            new ConfigExampleBuilder().WriteExampleConfig(serializer, PathManager.Instance.ExternalXmlExampleFolder);
        }