Ejemplo n.º 1
0
        public CommonProperties(
            XElement element,
            CommonAttributes attributes,
            Extension<EvaluationContextResolver> contextResolver)
            : base(element)
        {
            Contract.Requires<ArgumentNullException>(element != null);
            Contract.Requires<ArgumentNullException>(contextResolver != null);

            this.attributes = attributes;
            this.contextResolver = contextResolver;

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