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); }
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); }