Exemple #1
0
        /// <summary>
        /// 将parent重设为restriction.xml根节点
        /// </summary>
        public void ResetParent()
        {
            IXmlVisitorBase fileroot = root.Parent;

            while (fileroot != null)
            {
                root     = (XmlVisitor)fileroot;
                fileroot = root.Parent;
            }
        }
Exemple #2
0
        private IntRestriction CreatIntResriction(IXmlVisitorBase node)
        {
            IntRestriction res = new IntRestriction();

            try
            {
                if (node.Name == "INT")
                {
                    res.max = int.Parse(node.GetAttribute("MAX"));
                    res.min = int.Parse(node.GetAttribute("MIN"));
                    return(res);
                }
                throw new Exception();
            }
            catch
            {
                throw new Exception($"{node.ToString()} is invalide. IntRestriction should be <INT MAX=\"16383\" MIN=\"1\"/>");
            }
        }