Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="element"></param>
        /// <param name="context"></param>
        /// <param name="attributes"></param>
        public VarProperties(
            XElement element,
            VarAttributes attributes,
            Lazy<EvaluationContextResolver> context)
            : base(element)
        {
            Contract.Requires<ArgumentNullException>(element != null);
            Contract.Requires<ArgumentNullException>(attributes != null);
            Contract.Requires<ArgumentNullException>(context != null);

            this.attributes = attributes;
            this.context = context;

            this.value = new Lazy<XPathExpression>(() =>
                !string.IsNullOrEmpty(attributes.Value) ? context.Value.Context.CompileXPath(element, attributes.Value) : null);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="element"></param>
        /// <param name="context"></param>
        /// <param name="attributes"></param>
        public VarProperties(
            XElement element,
            VarAttributes attributes,
            Lazy <EvaluationContextResolver> context)
            : base(element)
        {
            Contract.Requires <ArgumentNullException>(element != null);
            Contract.Requires <ArgumentNullException>(attributes != null);
            Contract.Requires <ArgumentNullException>(context != null);

            this.attributes = attributes;
            this.context    = context;

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