/// <summary>Constructor with subject and variable naming strategy passed.</summary> /// <param name="variableNamingStrategy">Varialbe naming strategy.</param> /// <param name="variableNamingConvention">Variable naming convention.</param> internal Query(IVariableNamingStrategy variableNamingStrategy, IVariableNamingConvention variableNamingConvention) { _variableNamingStrategy = variableNamingStrategy; _variableNamingConvention = variableNamingConvention; _queryForm = QueryForms.Select; ObservableCollection <IPrefix> prefixes = new ObservableCollection <IPrefix>(); prefixes.CollectionChanged += OnCollectionChanged; _prefixes = prefixes; ObservableCollection <ISelectableQueryComponent> select = new ObservableCollection <ISelectableQueryComponent>(); select.CollectionChanged += OnCollectionChanged; _select = select; ObservableCollection <IQueryElement> elements = new ObservableCollection <IQueryElement>(); elements.CollectionChanged += OnCollectionChanged; _elements = elements; }
/// <summary>Constrctor with subject passed.</summary> /// <param name="subject">Subject of this query.</param> internal Query(Identifier subject) : base() { _queryForm = QueryForms.Select; ObservableCollection<Prefix> prefixes = new ObservableCollection<Prefix>(); prefixes.CollectionChanged += OnCollectionChanged; _prefixes = prefixes; ObservableCollection<ISelectableQueryComponent> select = new ObservableCollection<ISelectableQueryComponent>(); select.CollectionChanged += OnCollectionChanged; _select = select; ObservableCollection<QueryElement> elements = new ObservableCollection<QueryElement>(); elements.CollectionChanged += OnCollectionChanged; _elements = elements; _variableNamingStrategy = new UniqueVariableNamingStrategy(this); _variableNamingConvention = new CamelCaseVariableNamingConvention(); if ((_subject = subject) != null) { _subject.OwnerQuery = this; } }
/// <summary>Constructor with subject and variable naming strategy passed.</summary> /// <param name="subject">Subject of this query.</param> /// <param name="variableNamingStrategy">Varialbe naming strategy.</param> internal Query(Identifier subject, IVariableNamingStrategy variableNamingStrategy) : this(subject) { _variableNamingStrategy = variableNamingStrategy; _variableNamingConvention = new CamelCaseVariableNamingConvention(); }
/// <summary>Constructor with subject and variable naming strategy passed.</summary> /// <param name="subject">Subject of this query.</param> /// <param name="variableNamingStrategy">Varialbe naming strategy.</param> /// <param name="variableNamingConvention">Variable naming convention.</param> internal Query(Identifier subject, IVariableNamingStrategy variableNamingStrategy, IVariableNamingConvention variableNamingConvention) : this(variableNamingStrategy, variableNamingConvention) { if ((_subject = subject) != null) { _subject.OwnerQuery = this; } }