示例#1
0
        public static IExpression Expression(this IExpressionsManager manager, XElement element)
        {
            Configuration         config        = new Configuration();
            IConfigurationElement configElement = config.AddSection("expression extensions").AddElement("expression");

            configElement.ReadXml(element.CreateReader());
            IExpression expression = manager.Token(configElement.GetAttributeReference("type").Value.ToString()) as IExpression;

            if (null != expression)
            {
                expression.Make(configElement, manager);
            }
            return(expression);
        }
示例#2
0
        public static void FromXml(this IExpression expression, XElement element, IExpressionsManager expressionsManager)
        {
            if (null == expression)
            {
                throw new ArgumentNullException("expression");
            }
            if (null == element)
            {
                throw new ArgumentNullException("element");
            }
            if (null == expressionsManager)
            {
                throw new ArgumentNullException("expressionsManager");
            }

            Configuration         config        = new Configuration();
            IConfigurationElement configElement = config.AddSection("expression extensions").AddElement("expression");

            configElement.ReadXml(element.CreateReader());

            expression.Make(configElement, expressionsManager);
        }