public ViewsManager(string aConfigFile, IStorageAgent anAgent, IExpressionsManager expressionsManager) { if (String.IsNullOrEmpty(aConfigFile)) { throw new ArgumentNullException("aConfigFile"); } if (null == anAgent) { throw new ArgumentNullException("anAgent"); } if (null == expressionsManager) { throw new ArgumentNullException("expressionsManager"); } configFile = aConfigFile; agent = anAgent; this.ExpressionsManager = expressionsManager; this.Views = new ViewsCollection(this); this.Tables = new TablesCollection(this); this.Relations = new RelationsCollection(this); LoadConfiguration(); }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == config) throw new ArgumentNullException("config"); IConfigurationElement element = config as IConfigurationElement; if (null == element) throw new ArgumentException("config must be an IConfigurationElement"); if (element.Elements.ContainsKey("source")) { IConfigurationElement sourceElement = element.GetElementReference("source"); if (sourceElement.Attributes.ContainsKey("id")) { if (null == manager) throw new ArgumentNullException("manager"); this.Source = manager.FindControl(sourceElement.GetAttributeReference("id").Value.ToString()); if (null == this.Source) this.Source = sourceElement.GetAttributeReference("id").Value; if (sourceElement.Attributes.ContainsKey("member")) this.Member = sourceElement.GetAttributeReference("member").Value.ToString(); } else { if (sourceElement.Attributes.ContainsKey("value")) this.Source = sourceElement.GetAttributeReference("value").Value; } } }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == config) { throw new ArgumentNullException("config"); } if (null == manager) { throw new ArgumentNullException("manager"); } IConfigurationElement tokenElement = config as IConfigurationElement; if (null == tokenElement) { throw new ArgumentException("config is not an IConfigurationElement"); } if (!tokenElement.Elements.ContainsKey("source")) { throw new ConfigurationException("Bad views token configuration: 'source' element not found"); } IConfigurationElement sourceElement = tokenElement.GetElementReference("source"); if (!sourceElement.Attributes.ContainsKey("parameter")) { throw new ConfigurationException("Bad views token configuration: 'source' element has no 'parameter' attribute"); } this.ParameterName = sourceElement.GetAttributeReference("parameter").Value.ToString(); }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == config) { throw new ArgumentNullException("config"); } if (null == manager) { throw new ArgumentNullException("manager"); } IConfigurationElement tokenElement = config as IConfigurationElement; if (null == tokenElement) { throw new ArgumentException("config is not an IConfigurationElement"); } if (!tokenElement.Elements.ContainsKey("source")) { throw new ConfigurationException("Bad views field token configuration: 'source' element not found"); } IConfigurationElement sourceElement = tokenElement.GetElementReference("source"); Make(sourceElement, manager); }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == manager) { throw new ArgumentNullException("manager"); } if (null == config) { throw new ArgumentNullException("config"); } IConfigurationElement element = config as IConfigurationElement; if (null == element) { throw new ArgumentException("config must be an IConfigurationElement"); } if (element.Elements.ContainsKey("operands")) { foreach (IConfigurationElement operandElement in element.GetElementReference("operands").Elements.Values) { string type = operandElement.GetAttributeReference("type").Value.ToString(); IToken token = manager.Token(type); if (null == token) { throw new InvalidOperationException(string.Format("Cannot make the type '{0}'", type)); } token.Make(operandElement, manager); this.Operands.Add(token); } } }
public ViewsManager(XmlReader reader, IExpressionsManager expressionsManager) { if (null == expressionsManager) { throw new ArgumentNullException("expressionsManager"); } if (null == reader) { throw new ArgumentNullException("reader"); } this.ExpressionsManager = expressionsManager; this.Views = new ViewsCollection(this); this.Tables = new TablesCollection(this); this.Relations = new RelationsCollection(this); XElement root = XDocument.ReadFrom(reader) as XElement; if (null == root) { throw new ArgumentException("Failed to load the root element"); } FromXml(root); }
protected virtual void Make(IConfigurationElement sourceElement, IExpressionsManager manager) { if (null == sourceElement) throw new ArgumentNullException("sourceElement"); if (null == manager) throw new ArgumentNullException("manager"); if (!sourceElement.Attributes.ContainsKey("field")) throw new ConfigurationException("Bad views field token configuration: 'source' element has no 'field' attribute"); this.FieldName = sourceElement.GetAttributeReference("field").Value.ToString(); }
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); }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == config) throw new ArgumentNullException("config"); if (null == manager) throw new ArgumentNullException("manager"); IConfigurationElement tokenElement = config as IConfigurationElement; if (null == tokenElement) throw new ArgumentException("config is not an IConfigurationElement"); if (!tokenElement.Elements.ContainsKey("source")) throw new ConfigurationException("Bad views field token configuration: 'source' element not found"); IConfigurationElement sourceElement = tokenElement.GetElementReference("source"); Make(sourceElement, manager); }
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 ViewsManager(XmlReader reader, IExpressionsManager expressionsManager) { if (null == expressionsManager) throw new ArgumentNullException("expressionsManager"); if (null == reader) throw new ArgumentNullException("reader"); this.ExpressionsManager = expressionsManager; this.Views = new ViewsCollection(this); this.Tables = new TablesCollection(this); this.Relations = new RelationsCollection(this); XElement root = XDocument.ReadFrom(reader) as XElement; if (null == root) throw new ArgumentException("Failed to load the root element"); FromXml(root); }
public ViewsManager(string aConfigFile, IStorageAgent anAgent, IExpressionsManager expressionsManager) { if (String.IsNullOrEmpty(aConfigFile)) throw new ArgumentNullException("aConfigFile"); if (null == anAgent) throw new ArgumentNullException("anAgent"); if (null == expressionsManager) throw new ArgumentNullException("expressionsManager"); configFile = aConfigFile; agent = anAgent; this.ExpressionsManager = expressionsManager; this.Views = new ViewsCollection(this); this.Tables = new TablesCollection(this); this.Relations = new RelationsCollection(this); LoadConfiguration(); }
protected virtual void Make(IConfigurationElement sourceElement, IExpressionsManager manager) { if (null == sourceElement) { throw new ArgumentNullException("sourceElement"); } if (null == manager) { throw new ArgumentNullException("manager"); } if (!sourceElement.Attributes.ContainsKey("field")) { throw new ConfigurationException("Bad views field token configuration: 'source' element has no 'field' attribute"); } this.FieldName = sourceElement.GetAttributeReference("field").Value.ToString(); }
protected override void Make(IConfigurationElement sourceElement, IExpressionsManager manager) { if (null == sourceElement) { throw new ArgumentNullException("sourceElement"); } if (null == manager) { throw new ArgumentNullException("manager"); } if (!sourceElement.Attributes.ContainsKey("view")) { throw new ConfigurationException("Bad view as token configuration: 'source' element has no 'view' attribute"); } this.ViewName = sourceElement.GetAttributeReference("view").Value.ToString(); base.Make(sourceElement, manager); }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == config) { throw new ArgumentNullException("config"); } IConfigurationElement element = config as IConfigurationElement; if (null == element) { throw new ArgumentException("config must be an IConfigurationElement"); } if (element.Elements.ContainsKey("source")) { IConfigurationElement sourceElement = element.GetElementReference("source"); if (sourceElement.Attributes.ContainsKey("id")) { if (null == manager) { throw new ArgumentNullException("manager"); } this.Source = manager.FindControl(sourceElement.GetAttributeReference("id").Value.ToString()); if (null == this.Source) { this.Source = sourceElement.GetAttributeReference("id").Value; } if (sourceElement.Attributes.ContainsKey("member")) { this.Member = sourceElement.GetAttributeReference("member").Value.ToString(); } } else { if (sourceElement.Attributes.ContainsKey("value")) { this.Source = sourceElement.GetAttributeReference("value").Value; } } } }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == manager) throw new ArgumentNullException("manager"); if (null == config)throw new ArgumentNullException("config"); IConfigurationElement element = config as IConfigurationElement; if (null == element) throw new ArgumentException("config must be an IConfigurationElement"); if (element.Elements.ContainsKey("operands")) { foreach (IConfigurationElement operandElement in element.GetElementReference("operands").Elements.Values) { string type = operandElement.GetAttributeReference("type").Value.ToString(); IToken token = manager.Token(type); if (null == token) throw new InvalidOperationException(string.Format("Cannot make the type '{0}'", type)); token.Make(operandElement, manager); this.Operands.Add(token); } } }
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); }
public Database(string name, string viewsKey, IStorageAgent agent, IExpressionsManager expressionsManager) { this.Name = name; this.ViewsKey = viewsKey; this.ViewsManager = new ViewsManager(viewsKey, agent, expressionsManager); }
public virtual void Make(IConfigurationType config, IExpressionsManager manager) { }
private TransitPoint CreateTransitPoint(WebPartManager manager, IConfigurationElement element, IExpressionsManager expressionsManager) { bool valid = false; TransitPoint transitPoint = new TransitPoint(); if (element.Attributes.ContainsKey("id")) { valid = true; transitPoint.Chronicler = (ReflectionServices.FindControlEx(element.GetAttributeReference("id").Value.ToString(), manager) as IChronicler); } if (element.Attributes.ContainsKey("member")) { transitPoint.Member = element.GetAttributeReference("member").Value.ToString(); } if (element.Attributes.ContainsKey("value")) { valid = true; transitPoint.Value = element.GetAttributeReference("value").Value; } if (element.Elements.ContainsKey("expression")) { valid = true; IConfigurationElement expressionElement = element.GetElementReference("expression"); IExpression expression = expressionsManager.Token(expressionElement.GetAttributeReference("type").Value.ToString()) as IExpression; if (null == expression) { throw new InvalidOperationException("Token is not an IExpression"); } expression.Make(expressionElement, expressionsManager); transitPoint.Expression = expression; } if (!valid) { transitPoint = null; } return(transitPoint); }
public abstract void Make(IConfigurationType config, IExpressionsManager manager);
private TransitPoint CreateTransitPoint(WebPartManager manager, IConfigurationElement element, IExpressionsManager expressionsManager) { bool valid = false; TransitPoint transitPoint = new TransitPoint(); if (element.Attributes.ContainsKey("id")) { valid = true; transitPoint.Chronicler = (ReflectionServices.FindControlEx(element.GetAttributeReference("id").Value.ToString(), manager) as IChronicler); } if (element.Attributes.ContainsKey("member")) { transitPoint.Member = element.GetAttributeReference("member").Value.ToString(); } if (element.Attributes.ContainsKey("value")) { valid = true; transitPoint.Value = element.GetAttributeReference("value").Value; } if (element.Elements.ContainsKey("expression")) { valid = true; IConfigurationElement expressionElement = element.GetElementReference("expression"); IExpression expression = expressionsManager.Token(expressionElement.GetAttributeReference("type").Value.ToString()) as IExpression; if (null == expression) throw new InvalidOperationException("Token is not an IExpression"); expression.Make(expressionElement, expressionsManager); transitPoint.Expression = expression; } if (!valid) transitPoint = null; return transitPoint; }
public override void Make(IConfigurationType config, IExpressionsManager manager) { if (null == config) throw new ArgumentNullException("config"); if (null == manager) throw new ArgumentNullException("manager"); IConfigurationElement tokenElement = config as IConfigurationElement; if (null == tokenElement) throw new ArgumentException("config is not an IConfigurationElement"); if (!tokenElement.Elements.ContainsKey("source")) throw new ConfigurationException("Bad views token configuration: 'source' element not found"); IConfigurationElement sourceElement = tokenElement.GetElementReference("source"); if (!sourceElement.Attributes.ContainsKey("parameter")) throw new ConfigurationException("Bad views token configuration: 'source' element has no 'parameter' attribute"); this.ParameterName = sourceElement.GetAttributeReference("parameter").Value.ToString(); }
protected override void Make(IConfigurationElement sourceElement, IExpressionsManager manager) { if (null == sourceElement) throw new ArgumentNullException("sourceElement"); if (null == manager) throw new ArgumentNullException("manager"); if (!sourceElement.Attributes.ContainsKey("view")) throw new ConfigurationException("Bad view as token configuration: 'source' element has no 'view' attribute"); this.ViewName = sourceElement.GetAttributeReference("view").Value.ToString(); base.Make(sourceElement, manager); }