Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="xml"></param>
 /// <param name="context"></param>
 /// <param name="xpath"></param>
 internal Binding(XObject xml, EvaluationContext context, string xpath)
     : this(xml, context, context.CompileXPath(xml, xpath))
 {
     Contract.Requires <ArgumentNullException>(xml != null);
     Contract.Requires <ArgumentNullException>(context != null);
     Contract.Requires <ArgumentNullException>(xpath != null);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="xml"></param>
 /// <param name="context"></param>
 /// <param name="xpath"></param>
 internal Binding(XObject xml, EvaluationContext context, string xpath)
     : this(xml, context, context.CompileXPath(xml, xpath))
 {
     Contract.Requires<ArgumentNullException>(xml != null);
     Contract.Requires<ArgumentNullException>(context != null);
     Contract.Requires<ArgumentNullException>(xpath != null);
 }