示例#1
0
        new public static LogicalConnectiveCollection Load(XmlReader reader)
        {
            LogicalOrCollection loc = new LogicalOrCollection();

            loc.ReadXml(reader);

            return(loc);
        }
示例#2
0
        public static Term Load(XmlReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            Term evalExp = null;

            reader.MoveToStartElement();

            if (reader.IsRequiredStartElement(AuthorizationConstants.Elements.Rule))
            {
                Rule rule = new Rule();
                rule.ReadXml(reader);
                evalExp = rule;
            }

            if (reader.IsRequiredStartElement(AuthorizationConstants.Elements.LogicalAnd))
            {
                LogicalAndCollection logicalAnd = new LogicalAndCollection();
                logicalAnd.ReadXml(reader);
                evalExp = logicalAnd;
            }


            if (reader.IsRequiredStartElement(AuthorizationConstants.Elements.LogicalOr))
            {
                LogicalOrCollection logicalOr = new LogicalOrCollection();
                logicalOr.ReadXml(reader);
                evalExp = logicalOr;
            }

            if (evalExp != null)
            {
                return(evalExp);
            }
            else
            {
                throw new SerializationException("Invalid evaluation expression element.");
            }
        }