Пример #1
0
        static public BCVersion Parse(string s)
        {
            BCVersion outVar = new BCVersion();

            outVar.FromString(s);
            return(outVar.FromString(s) ? outVar : null);
        }
Пример #2
0
        public void Init()
        {
            BCVersion bufferVersion      = GetVersion(m_sParsedFilePath);
            bool      bNeedRebuildBuffer = false;

            if (bufferVersion == null)
            {
                bNeedRebuildBuffer = true;
            }
            else
            {
                BCVersion srcConfigVersion = GetVersion(m_sConfigFilePath);
                if (srcConfigVersion > bufferVersion)
                {
                    bNeedRebuildBuffer = true;
                }
            }

            if (bNeedRebuildBuffer)
            {
                m_units.LoadUnitConfigFile(m_sConfigFilePath);
            }
            else
            {
                try
                {
                    XmlDocument doc = new XmlDocument();
                    doc.Load(m_sParsedFilePath);
                    XmlElement root = doc.DocumentElement;
                    //m_units.Load(root);
                }
                catch (System.Exception) { }
            }
        }
Пример #3
0
        public static BCVersion GetVersion(string xmlFilePath)
        {
            string sVer = null;

            try
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(xmlFilePath);
                XmlElement root = doc.DocumentElement;
                sVer = root.GetAttribute("_version_");
            }
            catch (System.Exception) { }
            if (String.IsNullOrEmpty(sVer))
            {
                return(null);
            }
            return(BCVersion.Parse(sVer));
        }