Ejemplo n.º 1
0
        public RepeatExtensionProperties(
            XElement element, 
            EvaluationContext context)
        {
            Contract.Requires<ArgumentNullException>(element != null);
            Contract.Requires<ArgumentNullException>(context != null);

            this.attributes = element.AnnotationOrCreate(() => new RepeatExtensionAttributes(element));
            this.context = context;

            this.ref_ = new Lazy<XPathExpression>(() =>
                !string.IsNullOrEmpty(attributes.Ref) ?
                context.CompileXPath(element, attributes.Ref) :
                null);

            this.nodeSet = new Lazy<XPathExpression>(() =>
                !string.IsNullOrEmpty(attributes.NodeSet) ?
                context.CompileXPath(element, attributes.NodeSet) :
                null);

            this.indexRef = new Lazy<XPathExpression>(() =>
                !string.IsNullOrEmpty(attributes.IndexRef) ?
                context.CompileXPath(element, attributes.IndexRef) :
                null);
        }
Ejemplo n.º 2
0
        public RepeatExtensionProperties(
            XElement element,
            EvaluationContext context)
        {
            Contract.Requires <ArgumentNullException>(element != null);
            Contract.Requires <ArgumentNullException>(context != null);

            this.attributes = element.AnnotationOrCreate(() => new RepeatExtensionAttributes(element));
            this.context    = context;

            this.ref_ = new Lazy <XPathExpression>(() =>
                                                   !string.IsNullOrEmpty(attributes.Ref) ?
                                                   context.CompileXPath(element, attributes.Ref) :
                                                   null);

            this.nodeSet = new Lazy <XPathExpression>(() =>
                                                      !string.IsNullOrEmpty(attributes.NodeSet) ?
                                                      context.CompileXPath(element, attributes.NodeSet) :
                                                      null);

            this.indexRef = new Lazy <XPathExpression>(() =>
                                                       !string.IsNullOrEmpty(attributes.IndexRef) ?
                                                       context.CompileXPath(element, attributes.IndexRef) :
                                                       null);
        }