示例#1
0
        public void updateChannelXml(string game, string channel, string gameXml, string properties)
        {
            Dictionary <string, string> meatas = new channelManager().getChannelMetas(channel);

            if (meatas == null)
            {
                return;
            }

            PpHelper pt         = new PpHelper(properties);
            string   tmpXml     = FileUtil.setXmlColon(FileUtil.getContent(gameXml));
            string   xmlTmpFile = gameXml + @".tmp";

            //  MessageBox.Show(xmlTmpFile);
            FileUtil.writeContent(xmlTmpFile, tmpXml);

            //遍历添加meta-data
            foreach (KeyValuePair <string, string> pair in meatas)
            {
                addMeataData(pt, xmlTmpFile, pair.Key, pair.Value);
            }

            pt.Close();
            string tempXml = FileUtil.getContent(xmlTmpFile);

            tempXml = FileUtil.xmlRestore(tempXml);
            tmpXml  = FileUtil.replaceXmlColon(tempXml);
            FileUtil.writeContent(gameXml, tmpXml);
            File.Delete(xmlTmpFile);
        }
示例#2
0
        private bool isDebug()
        {
            bool     debug = false;
            PpHelper pt    = new PpHelper(envConfig.currenPath + @"\env.properties");

            if (pt.GetPropertiesText("debug") == "1")
            {
                debug = true;
            }
            else
            {
                debug = false;
            }
            pt.Close();
            return(debug);
        }